Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React port #397

Open
spacecat opened this issue Mar 31, 2024 · 2 comments
Open

React port #397

spacecat opened this issue Mar 31, 2024 · 2 comments

Comments

@spacecat
Copy link

Can we please port this to React? 🙏🏼

@robertsLando
Copy link
Collaborator

I don't understand what's the problem of using it on react as it is now. I'm using it with vue without any issue

@spacecat
Copy link
Author

spacecat commented Apr 3, 2024

I got it to work using dynamic imports in Next.js so no problem.

But having a dedicated component with hooks, props, APIs would be better since you would be taking advantage of SSR etc.

For those wondering how to wrap JustGage in a React component and then dynamically importing it, here's the link: https://nextjs.org/docs/app/building-your-application/optimizing/lazy-loading#nextdynamic

This is what you would do:

const ComponentC = dynamic(() => import('../components/C'), { ssr: false })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants