Document recommended eslint config
See original GitHub issueNot sure if this is intended or not, but I didn’t see anything in the documentation about it.
When using react-dom, it requires import of react even if react itself is never required. For example, in our project we have a backbone shim view that we use merely to render the page component:
ReactDOM.render(<SomePage/>, this.el);
No react-specific transform occurs on the page, however this fails because React is not available. I assume the problem here is the fact React.createElement is needed for the conversion from JSX to JS. While deduceable, this is not very intuitive. Also, this causes linters to fail on the import of React without actually using it anywhere. In both cases, I imagine not desirable behavior.
Any recommendations? I think at bare minimum this should be called out explicitly somewhere (and apologies if it already is and I just missed it).
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
@kkemple there may be some issues mentioned in https://github.com/facebook/react/issues/8035 that might be good to look at. We’d also appreciate any feedback on pending doc PRs!
Not really, and I’m not sure where we would add it. Right now the issue is not as bad because we recommend Create React App for beginners, and it includes the necessary lint rules. So perhaps this is not really super important.