Warning when custom component transfers variables
it looks like an unknown prop “***
” is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via <StyleSheetManager shouldForwardProp={...}>
(connect an API like @emotion/is-prop-valid
) or consider using transient props ($
prefix for automatic filtering.)
This means that we transferred an unknown prop variable to the DOM, triggering a React warning. To eliminate the warning, we can install a similar plug-in or add a symbol @emotion/is-prop-valid
in front of the incoming variable . I use the symbol to solve the problem here (note that from props Also add when taking the value )$
$
$
Before changing
- incoming
- use
After changing
- incoming
- use