Closed weblogixx closed 8 years ago
👍 that would be a great addition, especially as it is a core feature without an external dependency now.
We could build this on your current refactorings, maybe as its own style (stateless vs statefull vs cssmodulearized?). Or do you think it would be better to just wrap the current templates with ejs ifs?
I thought about this. IMO that's a good match for an if/else, as the condition only affects one token in the class extends
line.
If you are not already working on this, I would include this feature tomorrow
Haven't started work on this issue. If you have time and want to tackle it then that's great, otherwise feel free to assign me on it.
Sorry, I cannot, we`ll have to wait for the move first. Will do this tomorrow. Seems like a good place to start again ;).
Just added this in https://github.com/react-webpack-generators/generator-react-webpack/commit/4f9488cb9951d670ceb2074a469c19e64b3b5d69. Seems to work ok. Tests are getting more and more with every option we might add to the component generator. Maybe I should look more into testing here, as the style type approach does not differ that much (only the import style type filename is different).
👍 nice, and still no if-stmt in the templates. :-) Looking into the tests sounds reasonable, maybe in a separate issue to get this feature in quicker?
Yes, would think so, too. We should also think about adding coverage to the project (at least as a nice to have).
As seen in https://github.com/facebook/react/releases/tag/v15.3.0, we now have to possibility to use the following pattern with es2015 classes:
This will eliminate the need to handle shouldComponentUpdate by yourself or stateless functional components if you want to.
We should allow the user to extend from React.PureComponent, e.g. as a command line flag.
@sthzg: Whats your opinion on this?