Why is react-dom not part of peerDeps? #939
-
Just out of curiosity, why is react-dom not included in the peer dependencies in the react templates? It would make sense for me that they are included, and IIRC they used to be a couple versions ago. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
^That history would be the main reason. CRL only has I didn't write those templates, but another post-hoc rationalization may be: most React libraries generally do not import That being said, if your library has some limitation with respect to |
Beta Was this translation helpful? Give feedback.
react-dom
was never a peerDep in the templates. React itself was only added as a peerDep in 9f5c6de . The currentpackage.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.^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…