【问题标题】:Wrapping bit.dev components with a ThemeProvider使用 ThemeProvider 包装 bit.dev 组件
【发布时间】:2021-11-29 13:12:14
【问题描述】:

我想开始使用 bit.dev 跨多个应用管理 React 组件。每个应用都包含一个主题提供程序。

bit.dev playground 无法渲染组件,因为它们试图使用主题,但它们没有包含在主题提供程序中。

有没有办法将所有组件包装在提供程序中,但仅在 Playground UI 中使用时?

【问题讨论】:

  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: material-ui bit.dev themeprovider


【解决方案1】:

在你的环境中注册一个提供者,像这样: https://harmony-docs.bit.dev/aspects/envs/#preview

小心,因为这也会包装您的文档。

【讨论】:

    猜你喜欢
    • 2020-04-18
    • 2022-12-14
    • 1970-01-01
    • 1970-01-01
    • 2021-06-22
    • 2021-12-07
    • 2019-11-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多