Open patricklafrance opened 4 years ago
@patricklafrance hey 👋
It's also what I expect 😺 But, it's to hard to do it without runtime execution especially if propTypes
will come from other files.
Hi @layershifter
Maybe a first step would be to support the spread operator for local variables?
Something like this seems to do it: https://github.com/reactjs/react-docgen/pull/415/files#diff-b35f78065f9458034d34daff3f3a3a11R113
Patrick
I ended up rewriting my code to hooks and I don't need the plugin anymore. Feel free to close this issue if you feel it doesn't worth investing time in this.
Hi,
I believe this plugin should support using spread operators in the
propTypes
object.There is a test fixture for this case: https://github.com/layershifter/babel-plugin-transform-react-handled-props/tree/master/test/fixtures/spread
But the expected result seem wrong to me. I believe
handledProps
should include theactive
prop meaning:Example.handledProps = ["children", "className"
, "active"]`Thank you,
Patrick