Add React.createContext to @babel/plugin-transform-react-pure-annotations
See original GitHub issueFeature Request
- I would like to work on this feature! (I don’t actually care who works on this, but I’m happy to do it. Whatever is easier.)
Is your feature request related to a problem?
I have a React component library. When consuming applications use the library, a bunch of React.createContext calls are added to the bundle for components that aren’t even being used. This shouldn’t be the case as createContext
simply takes in some parameters and returns an object.
Describe the solution you’d like
Super pumped about the new @babel/plugin-transform-react-pure-annotations
package. I would like to add React.createContext to this PURE_CALLS map.
Describe alternatives you’ve considered.
Nothing. I’m open to them, but this seems straightforward enough.
Documentation, Adoption, Migration Strategy
Adoption and Migration are simple a npm update. Not sure is this is something that is documented or not. I’m guessing not.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
@babel/preset-react
uses^
to specify the version of the plugin, so it can already download the latest one.Oh, I totally missed that. Awesome!