You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to follow the tutorial, EditGuesser throws the following error:
TypeError: Cannot read property 'resource' of undefined
useResourceContext in node_modules/ra-core/esm/core/useResourceContext.js:40
37 | */
38 | export var useResourceContext = function (props) {
39 | var context = useContext(ResourceContext);
> 40 | return props.resource || context;
41 | };
42 |
EditViewGuesser in node_modules/ra-ui-materialui/esm/detail/EditGuesser.js:19
16 | import { EditView } from './EditView';
17 | import editFieldTypes from './editFieldTypes';
18 | var EditViewGuesser = function (props) {
> 19 | var resource = useResourceContext();
20 | var record = useEditContext().record;
21 | var _a = useState(null), inferredChild = _a[0], setInferredChild = _a[1];
22 | useEffect(function () {
I notice that EditGuesser was recently changed in #5728. In this commit, useResourceContext was also changed for props to be checked before props.resource is checked - i.e. props is made optional.
However, when merging #5730 the conflict was resolved improperly and useResourceContext is back to having props as required.
The text was updated successfully, but these errors were encountered:
maaarghk
added a commit
to maaarghk/react-admin
that referenced
this issue
Jan 9, 2021
When trying to follow the tutorial, EditGuesser throws the following error:
I notice that EditGuesser was recently changed in #5728. In this commit, useResourceContext was also changed for
props
to be checked beforeprops.resource
is checked - i.e.props
is made optional.However, when merging #5730 the conflict was resolved improperly and useResourceContext is back to having
props
as required.The text was updated successfully, but these errors were encountered: