Skip to content

Commit

Permalink
docs: add charcoal provider guide
Browse files Browse the repository at this point in the history
  • Loading branch information
yue4u committed Aug 28, 2024
1 parent e071f61 commit a7ed1a5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/react/docs/v4.0.0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,33 @@ function App() {
- テーマに関する属性が削除されました。
- `themeMap`, `defaultTheme`, `injectTokens`, `components`, `background`

Before

```tsx
// ...

<CharcoalProvider themeMap={themeMap}>
<YourApp />
</CharcoalProvider>
```

After

styled を継続して利用する場合

```tsx
// ...
import { TokenInjector } from '@charcoal-ui/styled'
import { ThemeProvider } from 'styled-components'

<CharcoalProvider>
<TokenInjector theme={themeMap} />
<ThemeProvider theme={themeMap[':root']}>
<YourApp />
</ThemeProvider>
</CharcoalProvider>
```

## Button

- `ComponentAbstraction``to`を用いたカスタム要素の設定を、`component``React.ElementType`を指定することによって行えるように変更しました。
Expand Down

0 comments on commit a7ed1a5

Please sign in to comment.