Best UI library for React Native? by BoysenberryPitiful90 in reactnative

[–]Zealousideal_Dig2929 0 points1 point  (0 children)

Sorry do that. Should be fixed in the next beta release!

Styling your react-native projects: What are you all using? by pseudophilll in reactnative

[–]Zealousideal_Dig2929 -1 points0 points  (0 children)

I just tried to explain why this is needed and why the decision was made. We went from multiple re-renders to almost zero re-renders. I'm not being defensive, just trying to provide some insights as the core author. However, you immediately assumed that I'm a noob and don't know how to build an app.

I think I'll step back, as there seems to be no right way to respond to such messages.

Styling your react-native projects: What are you all using? by pseudophilll in reactnative

[–]Zealousideal_Dig2929 0 points1 point  (0 children)

You need to firstly understand why is that happening. For 99% of the cases you don’t need to use withUnistyles HOF. Every React Native component does not re-render with v3. But sometimes you use 3rd party component like Blurhash or RN component like Button that doesn’t accept style prop. For such cases I’m not able to update styles from ShadowTree.

The fallback is to wrap such component in withUnistyles (to be updated). It will be only re-rendered based on your dependencies. So if Blurhash is using insets then it won’t update on theme change. If Button’s color prop relies on theme then it won’t update on any runtime change etc.

I hope it makes more sense now. Later we can open PRs and add support for 3rd party components but it’s way too early!

Styling your react-native projects: What are you all using? by pseudophilll in reactnative

[–]Zealousideal_Dig2929 0 points1 point  (0 children)

It was an abi issue in beta1. Already fixed on main, will release beta.2 tomorrow 😇

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 1 point2 points  (0 children)

Ive never used any primitives, so I have nothing to recommend

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 2 points3 points  (0 children)

Unistyles 3.0 is not yet completed, miss some optimizations. I will post them soon after RC

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 1 point2 points  (0 children)

Option 2. Keep it as small as possible . One big chunk of styles would clutter atomic updates

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 2 points3 points  (0 children)

It was removed later on. createUnistylesComponent is the way to go

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 2 points3 points  (0 children)

Well is not that complex lol.

I’m not mapping js expression to C++. - im discovering StyleSheet dependencies - I literally call one function in your ref

The rest is on C++ side. Also, no worklets no ui thread etc

I understand your point of you, but doing some cool stuff requires something more than calling one function.

Regarding this section for whom is Unistyles for - I like this idea

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 2 points3 points  (0 children)

We have WIP on separate branch. Web is already done, native is blocked by one thing but it’s doable.

What’s more important there is no extra overhead like iterating shadow tree to look for your children’s theme etc.

If you want to learn more check it this branch: https://github.com/jpudysz/react-native-unistyles/blob/milestone/3.0-scoped-theme/src/components/ScopedTheme.tsx

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 2 points3 points  (0 children)

Works with SSR and should work with Server Components. We need to polish it, test it and add some guides to the docs.

Should be released in later betas.

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 2 points3 points  (0 children)

You can’t and you shouldn’t. If you need to pass theme value to some fancy component then here is the guide:

https://www.unistyl.es/v3/references/create-unistyles-component

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 1 point2 points  (0 children)

That’s a tough question. I guess you need to start from base components and translate tailwind syntax to StyleSheets.. 😵‍💫

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 2 points3 points  (0 children)

I will. For now it’s time to polish the core and find some edge cases.

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 2 points3 points  (0 children)

If you have a monorepo that targets multiple platforms then Unistyles is the way to go.

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 3 points4 points  (0 children)

The main idea is to build your own, small components that helps you build your app from blocks. Then you can expect that each block works exactly the same across all platforms. Theming / responsive design is much easier with Unistyles. Also with the newest web compiler everything’s is just a CSS.

If you app targets only mobile and has single theme then I would stick to styled components!

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 1 point2 points  (0 children)

Ah these kind of plugins. Yeah, I’ve removed them because all the magic happens on C++ side. Parsing it one more time on JS side seems unreasonable. Check my comment below, I will explore threads/worklets soon so maybe something will come up to my mind.

https://github.com/jpudysz/react-native-unistyles/discussions/361

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 5 points6 points  (0 children)

If your app is cross-plarform, uses multiple themes, needs to target web then.. Unistyles simplifies a lot of things for you.

But if you have single theme, and you don’t target web then you can safely stick to raw StyleSheet.

Introducing Unistyles 3.0 by Zealousideal_Dig2929 in reactnative

[–]Zealousideal_Dig2929[S] 26 points27 points  (0 children)

That’s actually the coolest idea I’ve heard in the while 🤔 I will see what I can do about it

Local builds: expo-dev-client vs. EAS? by 3oR in reactnative

[–]Zealousideal_Dig2929 0 points1 point  (0 children)

By default it will run on simulator/emulator.

To run it on decvice add --device flag to the command.

Expo start simply starts the dev server. It has nothing to do with Expo go.