Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support createReactClass alternatives via config #176

Closed
tquetano-netflix opened this issue Jan 14, 2019 · 4 comments
Closed

Support createReactClass alternatives via config #176

tquetano-netflix opened this issue Jan 14, 2019 · 4 comments

Comments

@tquetano-netflix
Copy link
Contributor

Currently, when using the legacy create-react-class package, this plugin will only apply code removal if the name of the method doing the creation is createReactClass based on this line of source code, and this lines up with the documentation for React. That said, it should be fairly easy to allow configuration of this value by the options for the plugin (with the current createReactClass as default), and for our codebase where just createClass is used this would save us a lot of reconciliation time.

I can create a PR if you are open to this addition, this issue is just testing the waters in this regard.

@oliviertassinari
Copy link
Owner

@tquetano-netflix Sure, I have no objection with an option 👍 .

@tquetano-netflix
Copy link
Contributor Author

@oliviertassinari sweet, once I get a little time I'll throw a PR up.

@oliviertassinari
Copy link
Owner

Would #163 help?

@tquetano-netflix
Copy link
Contributor Author

tquetano-netflix commented Jan 14, 2019

EDIT: Wait I misread the PR you reference ... I think both are beneficial in slightly different ways. #163 allows for when createClass is on the React object, whereas my change allows for const createClass = require('create-react-class');.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants