Skip to content

Why is react-dom not part of peerDeps? #939

Answered by agilgur5
AndrewPrifer asked this question in General
Discussion options

You must be logged in to vote

IIRC they used to be a couple versions ago.

react-dom was never a peerDep in the templates. React itself was only added as a peerDep in 9f5c6de . The current package.json structure for the template code was created in #318, where this line left React as the only peerDep as well, and that line hasn't changed since.

Just out of curiosity, why is react-dom not included in the peer dependencies in the react templates?

^That history would be the main reason. CRL only has react as well.

I didn't write those templates, but another post-hoc rationalization may be: most React libraries generally do not import react-dom; ReactDOM.render is only called by the consumer of the library. React itsel…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@AndrewPrifer
Comment options

@agilgur5
Comment options

@AndrewPrifer
Comment options

Answer selected by AndrewPrifer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants