-
Notifications
You must be signed in to change notification settings - Fork 119
Open
Description
Description
Error importing CSS files within node_modules and compatibility with Nextjs app.
Reproduce
- Have a running Nextjs app.
- yarn add @dabeng/react-orgchart
- Add Organization chart to an empty page
//
import OrganizationChart from "@dabeng/react-orgchart"
import React from "react"
const DnDChart = () => {
const ds = {
id: "n1",
name: "Lao Lao",
title: "general manager",
children: [
{id: "n2", name: "Bo Miao", title: "department manager"},
{
id: "n3",
name: "Su Miao",
title: "department manager",
children: [
{id: "n4", name: "Tie Hua", title: "senior engineer"},
{
id: "n5",
name: "Hei Hei",
title: "senior engineer",
children: [
{id: "n6", name: "Dan Dan", title: "engineer"},
{id: "n7", name: "Xiang Xiang", title: "engineer"}
]
},
{id: "n8", name: "Pang Pang", title: "senior engineer"}
]
},
{id: "n9", name: "Hong Miao", title: "department manager"},
{
id: "n10",
name: "Chun Miao",
title: "department manager",
children: [{id: "n11", name: "Yue Yue", title: "senior engineer"}]
}
]
}
return <OrganizationChart datasource={ds} draggable={true} />
}
export default DnDChart
Cause
With Next.js importing CSS files within node_modules cannot be supported because we cannot know the correct behavior:
- Should the file be consumed as Global CSS or CSS Modules?
- If Global, in what order does the file need to be injected?
- If Modules, what are the emitted class names? As-is, camel-case, snake case?
- Etc.
More details: https://nextjs.org/docs/messages/css-npm
sdoxsee, hasnat5 and dmarkbreiter
Metadata
Metadata
Assignees
Labels
No labels
