I'm was making the shopping card Project and I decide to use Contextapi and useReducer for my state management at the start of my project I wrap the App in context Api and it crash my App Here is the Code.
****Main Index *******
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import Context from "./Context";
ReactDOM.render(
<React.StrictMode>
<Context>
<App />
</Context> </React.StrictMode>,
document.getElementById("root")
);
**** Context Api******
import { createContext } from "react";
const Card = createContext();
const Context = ({ childern }) => {
return <Card.Provider>{childern}</Card.Provider>;
};
export default Context;