Skip to content

RAC as dependency in component library #5886

Closed Answered by BMCwebdev
BMCwebdev asked this question in Q&A
Discussion options

You must be logged in to vote

Well I learned something today:

When react-aria-components is bundled with my-component-library, consumers of my-component-library cannot directly import DialogTrigger or any other component from react-aria-components using the import statement

import { DialogTrigger } from 'react-aria-components';

This is because react-aria-components is a nested dependency within my-component-library, and the way Node.js and most bundlers like Webpack or Vite handle module resolution, they do not allow importing nested dependencies directly by default. The standard behavior is to resolve dependencies from the project's top-level node_modules directory. Since react-aria-components is not a top-level depe…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@snowystinger
Comment options

Answer selected by BMCwebdev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants