Closed parth391 closed 1 year ago
Version: Laravel: 9.29.0 inertiajs/inertia: 0.11.0 inertiajs/inertia-react: 0.8.1
My code(ssr.jsx)
createServer((page) => createInertiaApp({ page, render: ReactDOMServer.renderToString, title: (title) => `${title} - ${appName}`, resolve(name) {...}, setup: ({ App, props }) => { global.route = (name, params, absolute) => route(name, params, absolute, { ...page.props.ziggy, location: new URL(page.props.ziggy.location), }); return (<LaravelReactI18nProvider lang={'en'} fallbackLang={'pt'} resolve={async (lang) => { const langs = import.meta.globEager('/lang/*.json') return await langs[`/lang/${lang}.json`]() } }> <App {...props} /> </LaravelReactI18nProvider>); }, }) );
Error
Warning: Invalid hook call. Hooks can only be called inside of the body of a function component.
@EugeneMeles, can you look at this issue, also?
Update to latest(2.0.0) version
Version: Laravel: 9.29.0 inertiajs/inertia: 0.11.0 inertiajs/inertia-react: 0.8.1
My code(ssr.jsx)
Error