Why is usePrefix overwritten by settings in carbon-components? #9791
-
Packagecarbon-components, carbon-components-react BrowserChrome, Firefox Package version@carbon/[email protected], [email protected], [email protected] DescriptionComponents are not receiving the expected class prefix: If I'm reading correctly, this may be caused by the prefix set in Perhaps the order in which the packages are required causes the prefix in CodeSandbox examplehttps://codesandbox.io/s/upbeat-ganguly-k6phd?file=/src/index.js Steps to reproduceI couldn't load
@use '@carbon/react';
import './App.scss' // This loads the cds styles as expected
import { AnyComponent } from '@carbon/react'
export const App = () => <AnyComponent/> // This component will have a bx-prefixed className applied. Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @TastyDucks - sorry for the confusion here!
This is outlined in more detail in the v11 migration guide (also still in beta and a WIP) So overall, the fix here is to either use I'm not sure what's up with the versioning on codesandbox. I was able to make a fork of your codesandbox with the newer 0.6.0 version of |
Beta Was this translation helpful? Give feedback.
Hey @TastyDucks - sorry for the confusion here!
@carbon/react
is in preview. It's part of the current beta for our v11 release and is intended to replacecarbon-components
andcarbon-components-react
.@carbon/react
forwards styles from@carbon/styles
and it also includes the same components (with some v11 updates) fromcarbon-components-react
.This is outlined in more detail in the v11 migration guide (also still in beta and a WIP)
So overall, the fix here is to either use
@carbon/react
exclusively for components and styles, or usecarbon-components
withcarbon-components-react
.I'm not sure what's up with the versioning on codesandbox. I was able to make a fork of your codesandbox with t…