Skip to content

Commit

Permalink
fix: add "use client" to non hook components like the Button (#2895)
Browse files Browse the repository at this point in the history
With that change we increase the number of affected files from 30 to 80.
  • Loading branch information
tujoworker authored Nov 14, 2023
1 parent d66b723 commit 2d54a13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion packages/dnb-eufemia/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,19 @@ const productionPlugins = [
]

if (global.bundler !== 'rollup') {
productionPlugins.push('babel-plugin-transform-next-use-client')
productionPlugins.push([
'babel-plugin-transform-next-use-client',
{
customClientImports: [
'Context',
'Provider',
'useMedia',
'useMediaQuery',
'useEventEmitter',
'useTheme',
],
},
])
}

if (typeof process.env.BABEL_ENV !== 'undefined') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('babel build', () => {
const content = fs.readFileSync(
path.resolve(
packpath.self(),
`build${stage}/components/accordion/Accordion.js`
`build${stage}/components/button/Button.js`
),
'utf-8'
)
Expand Down

0 comments on commit 2d54a13

Please sign in to comment.