nativewind component library

Hi, I'm looking into making a bastard child between https://github.com/vercel/turbo/tree/main/examples/with-react-native-web and https://github.com/t3-oss/create-t3-turbo/tree/main, I'm planning on having 4 apps in the same turbo-based monorepo, 3 are mobile apps and one is the admin dashboard (nextjs). I'd like the admin to be able to preview what people will see in the apps easily so I was thinking about using react-native-web to display the native components in nextjs. The main problem I'm having is with integrating native-wind in a component library, Any existing repository I could use as an example you know of ?
GitHub
turbo/examples/with-react-native-web at main · vercel/turbo
Incremental bundler and build system optimized for JavaScript and TypeScript, written in Rust – including Turbopack and Turborepo. - vercel/turbo
2 Replies
Porto
Porto13mo ago
It would be easier to create a the 3 app's and the dashboard using expo (it has native support for react-native-web) and share the components that way. The convenience of this approach is that you going to have a web version for your app's and also an app version of your dashboard Or if you really want to use next for the dashboard you can build the app's for web and point to them using a iframe
Niks
NiksOP13mo ago
Thanks for the attention, the problem isn't that much the react-native-web part, using a react-native component in a nextjs isn't much work. The problem really is (was) on the build step as I want the component library to be bundled and the apps to use the bundled version, and I'm (probably was) having issues with using nativewind to do that. That would be usefull both with big "expo only" monorepos, and when mixing it with react-native-web. But I think I found a path I'll try tomorrow to fix that, globally using rollup+babel for the bundling should fit my needs, (using https://github.com/daboigbae/react-native-component-lib as an example, simplifing a lot of it), I'll post a template here once I'm satisfied with my setup, (probably once I finish the project)
Want results from more Discord servers?
Add your server