question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React does not recognize the `basePath` prop on a DOM element

See original GitHub issue

Simple form generates “React does not recognize the basePath prop on a DOM element”

Applying next change in node_modules (: ) fixes the error

export var FormInput = function (_a) {
   // appending "basePath" fixes error
    var classes = _a.classes, input = _a.input, rest = __rest(_a, ["classes", "input", "basePath"]);
    console.log(rest)
    var _b, _c;
    return input ? (React.createElement("div", { className: classnames('ra-input', "ra-input-" + input.props.source, input.props.formClassName) }, input.props.addLabel ? (React.createElement(Labeled, __assign({ id: input.props.id || input.props.source }, input.props, sanitizeRestProps(rest)), React.cloneElement(input, __assign({ className: classnames((_b = {},
            _b[classes.input] = !input.props.fullWidth,
            _b), input.props.className), id: input.props.id || input.props.source }, rest)))) : (React.cloneElement(input, __assign({ className: classnames((_c = {},
            _c[classes.input] = !input.props.fullWidth,
            _c), input.props.className), id: input.props.id || input.props.source }, rest))))) : null;
};

Environment

  • React-admin version: “ra-core” “2.8.6”,
  • React version: “react” “16.8.6”,
  • Browser: Chrome
  • Stack trace (in case of a JS error):
index.js:1437 Warning: React does not recognize the `basePath` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `basepath` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in span (at form/index.js:73)
    in div (created by FormInput)
    in FormInput (created by WithStyles(FormInput))
    in WithStyles(FormInput) (created by FormTab)
    in span (created by FormTab)
    in FormTab (created by Context.Consumer)
    in translate(FormTab) (at form/index.js:29)
    in Route (created by TabbedForm)
    in div (created by CardContent)
    in CardContent (created by WithStyles(CardContent))
    in WithStyles(CardContent) (created by CardContentInner)
    in CardContentInner (created by WithStyles(CardContentInner))
    in WithStyles(CardContentInner) (created by TabbedForm)
    in form (created by TabbedForm)
    in TabbedForm (created by WithStyles(TabbedForm))
    in WithStyles(TabbedForm) (created by Form(WithStyles(TabbedForm)))
    in Form(WithStyles(TabbedForm)) (created by Connect(Form(WithStyles(TabbedForm))))
    in Connect(Form(WithStyles(TabbedForm))) (created by ReduxForm)
    in ReduxForm (created by Context.Consumer)
    in translate(ReduxForm) (created by Connect(translate(ReduxForm)))
    in Connect(translate(ReduxForm)) (created by Route)
    in Route (created by withRouter(Connect(translate(ReduxForm))))
    in withRouter(Connect(translate(ReduxForm))) (at form/index.js:28)

the value of basePath is the name of my resource

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

15reactions
fzaninottocommented, Dec 11, 2019

The SimpleFormIterator only accepts Input elements as children. For your use case, you must create a new form iterator.

2reactions
djhicommented, Jun 5, 2020

There is no documentation on this subject yet. You’ll have to read the code of the SimpleFormIterator

Read more comments on GitHub >

github_iconTop Results From Across the Web

React does not recognize the `basePath` prop on a DOM ...
Expected Behaviour: No warning of prop when Grid component is used inside SimpleForm component. Current Behaviour: Getting below warning.
Read more >
How to fix the React does not recognize the `basePath ...
Warning : React does not recognize the basePath prop on a DOM element. If you intentionally want it to appear in the DOM...
Read more >
Unknown Prop Warning - React
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >
warning: react does not recognize the prop on a dom element.
react does not recognize the basepath prop on a dom element. If you are trying to attach custom data to a standard DOM...
Read more >
Warning: React does not recognize the `isOpen` prop on a DOM
prop on a DOM element. i got solved this issue. just change tag to Navlink because ActiveClassName is just suported Navlink.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found