2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

chakra-ui v3のProviderが効かない

2
Posted at

はじめに

  • v3系

問題

  • 今まで以下のようにしていたが、公式を見るとProviderを読み込むべきだったようなので、そのようにしたがインポートできない
import { ChakraProvider } from "@chakra-ui/react";

function App() {
  return (
    <ChakraProvider value={userDefSystem}>
      <Hogehoge />
    </ChakraProvider>
  );
}

export default App;

解決

  • npx @chakra-ui/cli snippet add を実行した時に作成されたコンポーネントをimportして解決
import { Provider } from "./components/ui/provider.tsx";

createRoot(document.getElementById("root")!).render(
  <Provider>
    <Hogehoge />
  </Provider>,
);

終わりに

  • 手順を飛ばさずやれば問題なく実施できた

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?