-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
[code-infra] Enable React compiler eslint plugin #4121
Conversation
Taking a look. |
@@ -435,8 +436,9 @@ function DashboardLayout(props: DashboardLayoutProps) { | |||
|
|||
// If useEffect was used, the reset would also happen on the client render after SSR which we don't need | |||
React.useMemo(() => { | |||
selectedItemIdRef.current = ''; | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
if (navigation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the selected item come from a context will eventually get rid of this so I guess this workaround should work for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you seen that I added a bunch of helpers to optimize translating paths to navigation items and vice versa
https://github.com/mui/toolpad/blob/master/packages/toolpad-core/src/shared/navigation.tsx#L61-L166
it's being used by the new PageContainer
breadcrumbs calculation. I expect a lot of it to be reusable for DashboardLayout. It adds some global caching to avoid recalculating these path => item maps over and over again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I'll try to use them!
@apedroferreira There is one error left:
Would you mind taking a look at it?