"The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as a legal DOM attribute/property." In this case, since @props are passed as-is to the child div using ..., the div ends up with invalid html properties.
Links
Problem
"The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as a legal DOM attribute/property." In this case, since
@props
are passed as-is to the childdiv
using...
, the div ends up with invalid html properties.Solution
Coffeescript doesn't seem to have support for the succinct solution:
So I used
Object.assign
for making a copy of props and then removing the unwanted keys.Test plan
I built the project by:
npm install
peerDependencies
)make build
And tested it in my project using
npm link
. It stopped showing the warning!