Skip to content

Commit

Permalink
fix: add "use client" to non hook components like the Button
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Nov 13, 2023
1 parent 4800a8e commit cc1c3d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion packages/dnb-eufemia/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,18 @@ const productionPlugins = [
]

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

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 cc1c3d4

Please sign in to comment.