Open graingert opened 6 years ago
It will break backwards compatibility because you need to import the '@babel/' rather than 'babel-' versions of the packages
On Tue, 17 Apr 2018, 23:13 Neil Kistner, notifications@github.com wrote:
Will it be a breaking change to support babel 7, or is there a way to maintain backwards compatibility?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wyze/babel-plugin-transform-react-stateless-component-name/issues/11#issuecomment-382172055, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZQTBDlpCfUf7-gTYZMOx-sfqP8kC0Rks5tpmjsgaJpZM4TN01k .
Okay, thank you!
@wyze/@graingert -- Does this transform currently work with Babel@7? We're already on Babel@7, however we're just starting to use functional components much more heavily (because of hooks).
I'm not sure if it works as the code is, but I'm open to accepting a PR to get it updated if not. It might only need the dependencies updated.
Tried just updating deps. AVA tests pass, but rewired CRA DevTools still just show <Unknown>...</Unknown>
tbh not sure how I got down this rabbit hole. I don't even really need this plugin. 🤔
Just do this:
const Foo = () => <h1>foo</h1>
export default Foo
...and DevTools will label it correctly.
The problem is when you do export default () => <h1>foo</h1>
On Tue, 28 May 2019, 03:54 Cory Simmons, notifications@github.com wrote:
Tried just updating deps https://github.com/corysimmons/babel-plugin-transform-react-stateless-component-name/commit/890cecb2af4e9648aee0483813bf30acc022de9d. AVA tests pass, but rewired CRA DevTools still just show
... tbh not sure how I got down this rabbit hole. I don't even really need this plugin. 🤔
Just do this:
const Foo = () =>
foo
export default Foo
...and DevTools will label it correctly.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wyze/babel-plugin-transform-react-stateless-component-name/issues/11?email_source=notifications&email_token=AADFATEGFYYR4SMW3OTBJGDPXSNFNA5CNFSM4EZXJVSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWK2LGY#issuecomment-496346523, or mute the thread https://github.com/notifications/unsubscribe-auth/AADFATFBD3UZKDC7QBIEMFDPXSNFNANCNFSM4EZXJVSA .
I thought that was the whole point of this plugin? So that you could do export default () => ...
and wherever you import Foo from '../MyStatelessFunction
it, it would display as <Foo>...</Foo>
in React Devtools? :\
Yes that's the point
Will it be a breaking change to support babel 7, or is there a way to maintain backwards compatibility?