r/reactjs • u/Shubham4538 • Oct 14 '26
Shadcn components unable to render
I added a shadcn component to my vite + tailwind project with using `npx shadcn@latest add @/react-bits/Particles-JS-TW` and after importing the component
import Particles from "./components/Particles";
It shows an awesnap image, i dont know the reason, the other things were rendering good alongside but just the components showing error
6
Upvotes
1
u/Shubham4538 Oct 15 '26
Just got the solution, removed line 864 from Particles.jsx, inside useEffect
gl.getExtension('WEBGL_lose_context')?.loseContext():Helps the context, so when it unmounts, the context doesn't loose its contents
1
u/PrimaryFamous6139 NextJS Pages Router Oct 14 '26
Check console and terminal for the actual error. Also verify the import path and file extension. In Vite, try importing with a relative path like ./components/Particles or your configured alias, rather than /components/Particles. If it’s a React Bits component, make sure all its dependencies are installed and the component matches your React version
1
u/CarNage_ZA Oct 15 '26
Ask AI?
2
u/[deleted] Oct 14 '26
[removed] — view removed comment
1
u/[deleted] Oct 14 '26
[removed] — view removed comment