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

Error when using with react 16 #2178

Open
sinnbeck opened this issue Jan 10, 2025 Discussed in #2177 · 1 comment
Open

Error when using with react 16 #2178

sinnbeck opened this issue Jan 10, 2025 Discussed in #2177 · 1 comment

Comments

@sinnbeck
Copy link

Discussed in #2177

Originally posted by sinnbeck January 10, 2025
I am starting to modernize an older app and sadly it is using react 16. But I want to rewrite the admin to use inertia and according to the package.json it should support it

But I am getting an error whenever I click on a <Link>

I just return a link directly so there is no extra stuff

return <Link href="/admin">CLICK ME</Link>

I get this error on click
image

The only "big" change I had to make was how I use react dom

createInertiaApp({
    resolve: name => require(`./Pages/${name}`),
    setup({el, App, props}) {
        ReactDom.render(<App {...props} />, el) //instead of createRoot()
    },
})
</div>
@sinnbeck
Copy link
Author

I upgraded to react 17 just to test it and it works. So perhaps I would be a good idea to remove 16.9 from package.json

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

1 participant