Repository navigation
Slate-dom Peer Dependency #5879
|
Do we need to add slate-dom to our package.json dependencies moving forward or is it included in one of the other dependencies? It seems like it didn't need to be explicitly added in previous versions of slate. |
Replies: 1 comment
|
Yes, for versions of npm view slate-react@0.133.8 peerDependenciesIt lists npm install slate@0.133.7 slate-react@0.133.8 slate-dom@0.133.6npm versions that install peer dependencies automatically may make an omitted direct dependency appear to work, but declaring it explicitly records the application's dependency and avoids relying on that behavior. For an existing project, check the peer range of your pinned slate-react version rather than upgrading blindly to this example set. Older releases can have a different dependency layout. The tested set resolved all three packages and rendered an actual Slate/Editable paragraph with React 18.2.0. Published slate-react package metadata, npm peer dependencies. |
Yes, for versions of
slate-reactthat declareslate-domas a peer dependency, declare it in the consuming application's dependencies too. For example, the published package metadata I checked is:It lists
slate-dom: '>=0.133.6'alongsideslate: '>=0.121.0'and the React peers. A compatible versioned set I installed and tested was:npm versions that install peer dependencies automatically may make an omitted direct dependency appear to work, but declaring it explicitly records the application's dependency and avoids relying on that behavior. For an existing project, check the peer …