Skip to content

Commit

Permalink
fix: get dls component path
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Jul 29, 2024
1 parent f6109b0 commit 6b022a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"prettier --ignore-path ./.gitignore --write "
],
"*.{js,ts,cjs,mjs,jsx,tsx,json}": [
"biome lint --apply --no-errors-on-unmatched"
"biome lint --write --no-errors-on-unmatched"
]
},
"scripts": {
Expand All @@ -33,7 +33,7 @@
"analyze": "cross-env NODE_ENV=production ANALYZE=true BUNDLE_ANALYZE=browser next build",
"build": "cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 next build",
"build:ci": "cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 NEXT_TELEMETRY_DISABLED=1 CI=true next build",
"lint": "biome lint --apply src/**/*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json} --no-errors-on-unmatched",
"lint": "biome lint --write src/**/*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json} --no-errors-on-unmatched",
"prod:pm2": "cross-env NODE_ENV=production pm2 restart ecosystem.config.cjs",
"prod:stop": "pm2 stop ecosystem.config.cjs",
"prod:reload": "pm2 reload ecosystem.config.cjs"
Expand Down
3 changes: 2 additions & 1 deletion src/components/ui/react-component-render/ComponentRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const ReactComponentRenderImpl: FC<DlsProps> = (dlsProps) => {
const style = useContext(StyleContext)
useIsomorphicLayoutEffect(() => {
loadScript(dlsProps.import).then(() => {
const Component = get(window, dlsProps.name)
const Component =
get(window, `${dlsProps.name}.default`) || get(window, dlsProps.name)

setComponent({ component: Component })
})
Expand Down

0 comments on commit 6b022a1

Please sign in to comment.