mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-07 14:08:47 +00:00
bug fix: type error in chart.tsx (#4230)
# Current Issue when running `next lint`, the typescript compiler fails on the chart component (closes #4229 ) `Type error: Type 'string[]' is not assignable to type 'string | TrustedHTML'.` # Resolution We can coerce the `string[]` into a valid type by `join`ing.
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -79,8 +79,9 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
||||
return (
|
||||
<style
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: Object.entries(THEMES).map(
|
||||
([theme, prefix]) => `
|
||||
__html: Object.entries(THEMES)
|
||||
.map(
|
||||
([theme, prefix]) => `
|
||||
${prefix} [data-chart=${id}] {
|
||||
${colorConfig
|
||||
.map(([key, itemConfig]) => {
|
||||
@@ -92,7 +93,8 @@ ${colorConfig
|
||||
.join("\n")}
|
||||
}
|
||||
`
|
||||
),
|
||||
)
|
||||
.join("\n"),
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -79,8 +79,9 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
||||
return (
|
||||
<style
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: Object.entries(THEMES).map(
|
||||
([theme, prefix]) => `
|
||||
__html: Object.entries(THEMES)
|
||||
.map(
|
||||
([theme, prefix]) => `
|
||||
${prefix} [data-chart=${id}] {
|
||||
${colorConfig
|
||||
.map(([key, itemConfig]) => {
|
||||
@@ -92,7 +93,8 @@ ${colorConfig
|
||||
.join("\n")}
|
||||
}
|
||||
`
|
||||
),
|
||||
)
|
||||
.join("\n"),
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user