Versions issue with shadcn/tailwind-4 and React 18
I'm unable to find much info about this maybe unusual setup(?)
Starting new (vite) project, so I naturally want to use latest shadcn/tailwind.
But also trying to stay on React 18 to avoid (yet unknown) possible issues, because I plan to use this project as remote in with module-federation that has other react 18 apps.
Currently with this setup on a project, seems like shadcn cli still installs components (without forwardRef and other stuff) like I'm on React 19. I'm unable to find how to control this. Seems like both latest shadcn and tailwind should support react 18, and I'm not supposed to downgrade them?
It's also possible that all of this could be avoided with just using React 19, but currently it's complicated for me to experiment with that setup and module-federation.
4 Replies
Just use an older version of the shadcn package

Next.js
Install and configure shadcn/ui for Next.js.
I think this helps. If you're using tailwind v4, you can always manually change the class names but would be weird to use tailwind v4 and not react 19
Thanks for the reply!