Details
-
Improvement
-
Resolution: Done
-
Critical
-
None
-
None
-
None
-
None
Description
This has been the Discovery Ticket.
The feaature will be implemented with this epic: https://jira.magnolia-cms.com/browse/MGNLFE-558
Next.js 13 introduced new routing mechanism called: App Router
**
It is recommended way of routing for new apps, and old should migrate as per: https://nextjs.org/docs/app
It also introduced the idea of Server and Server Components, to explicitly split between code rendered on server and on client side.
@magnolia/react-editor is using React context to share data between components.
New approach does not allow using context in server components throwing error:
TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component
Using `use client` makes the fetching of page data happen on client side = opposite what we want from Next.js
We should refactor React lib to stop using context for sharing data across components.
Ideally using vanilla JS that would avoid conflicting with any changes in the future.
Checklists
Attachments
Issue Links
- is causing
-
MGNLFE-558 React editor has experimental NEXT.js 13 App Router
-
- Closed
-