1

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?

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.