What you were expecting:
In react-admin/packages/ra-ui-materialui/src/layout/Menu.js, line 102~103,
there exists a loose equality for path comparison, in common case we use strict equality more.
What happened instead:
It cause linting notice while I try to use fork Menu.js out and use it.
Steps to reproduce:
Just fork the Menu.js out, import it and run the code
Related code:
const enhance = compose(
translate,
connect(
mapStateToProps,
{}, // Avoid connect passing dispatch in props,
null,
{
areStatePropsEqual: (prev, next) =>
prev.resources.every(
(value, index) => value === next.resources[index] // shallow compare resources
) &&
prev.pathname == next.pathname &&
prev.open == next.open,
}
),
withStyles(styles)
);
Other information:
I just want to know, is the loose equality here intended to prevent some issue or not?
if I swap the loose equality here to strict equality, will it break the code or lose some functionality?
Environment
- React-admin version: 2.5.0
- Last version that did not exhibit the issue (if applicable):
- React version:
- Browser:
- Stack trace (in case of a JS error):
What you were expecting:
In
react-admin/packages/ra-ui-materialui/src/layout/Menu.js, line 102~103,there exists a loose equality for path comparison, in common case we use strict equality more.
What happened instead:
It cause linting notice while I try to use fork Menu.js out and use it.
Steps to reproduce:
Just fork the Menu.js out, import it and run the code
Related code:
Other information:
I just want to know, is the loose equality here intended to prevent some issue or not?
if I swap the loose equality here to strict equality, will it break the code or lose some functionality?
Environment