Reputation: 538
I'm making a React component library that will be consumed in a Next.js project. I would like to add features of Next.js into my components.
Will simply adding Next.js as a dev dependency in the component library be enough?
Upvotes: 1
Views: 1206
Reputation: 7944
If you are planning to publish your component as a package, you need to add next.js to peerDependencies
. Doing so indicates your project depends on stuff from next.js but it is not included in your package and should be installed on the actual project itself.
For details please see here: https://classic.yarnpkg.com/en/docs/dependency-types/#toc-peerdependencies
Upvotes: 1