Closed kozlikov closed 3 years ago
@kozlikov react-nanny
doesn't add any props to any components so I'm guessing that you might have it bleeding through a rest prop.
Where your component is possibly something like this:
import React from 'react';
const Hello = ({ ...other }) => <div {...other}>Hello World!</div>;
Hello.defaultProps = {
__TYPE: 'Hello',
};
Where it should be something like this:
import React from 'react';
const Hello = ({ __TYPE, ...other }) => <div {...other}>Hello World!</div>;
Hello.defaultProps = {
__TYPE: 'Hello',
};
(notice that __TYPE
is an unused constant not included in the render)
Let me know if that helps. Otherwise, if you could post some code of your usage, I'd be more than happy to take a look.
@TheSpicyMeatball Yes, of course, please, here's an example in the codebox:
https://codesandbox.io/s/exmaple31212020-whkt8?file=/src/App.js
P.S. Perhaps this is due to the new version of react.
Change this line (line #6)...
const { children, ...other } = props;
To this...
const { children, __TYPE, ...other } = props;
That will keep __TYPE
from ending up in your DOM.
Oh, with this react, that I already forgot about the default html tags and their parameters))
Thank you very much!!!
You got it!
Hello!
Unfortunately, the reagent issues an inconvenient warning and is very annoying when developing if additional other errors or warnings appear.
It would be great if we fix this behavior...