[英]Wrapping bit.dev components with a ThemeProvider
I want to start using bit.dev to manage React components across multiple apps.我想开始使用 bit.dev 跨多个应用程序管理 React 组件。 Each app is wrapped with a Theme provider.
每个应用程序都包含一个主题提供程序。
The bit.dev playground is failing to render the components since they are trying to consume a theme but they are not wrapped in a theme provider. bit.dev 游乐场无法呈现组件,因为它们试图使用主题,但它们没有包含在主题提供程序中。
Is there a way to wrap all components in a provider but only when being used within the playground UI?有没有办法将所有组件包装在提供程序中,但仅在操场 UI 中使用时?
register a Provider in your env, like so: https://harmony-docs.bit.dev/aspects/envs/#preview在您的环境中注册一个提供程序,如下所示: https://harmony-docs.bit.dev/aspects/envs/#preview
Be careful, as this will also wrap your documentation.小心,因为这也会包装您的文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.