title: How can I set data createContext?
body: <p>How can I set data into the state?</p>
  <p>And how can I solve <code>createContext</code> error?</p>
  <pre class="lang-js prettyprint-override"><code>export const LastChanceContext = createContext() //in there return error: Expected 1 arguments, but got 0.
  
  export const GET_LASTCHANCE = &quot;GET_LASTCHANCE&quot;
  
  
  const LastChanceWrapper = ({children} : {children:any}) =&gt; {
  
      const initialState = {
          lastChances: [],
          lastChance: {}
      };
      console.log('asd',initialState);
  
      const [state, dispatch] = useReducer(lastChanceReducer, initialState);
  
      useEffect(() =&gt; {
          const getLastChance = async () =&gt; {
              const result = await axiosFetch('http://65.21.148.176:2803/api/Home/Get');
              const action = {
                  type:GET_LASTCHANCE,
                  payload:result.data.data.lastChanceList
              };
              if(Object.keys(result).length !== 0) {
                   dispatch(
                       {state,
                      action}
                   )
  
                  console.log(result.data.data.lastChanceList);
              }
  
          };
  
          getLastChance();
      }, [])
  
  
      return (
          &lt;LastChanceContext.Provider value={{
              lastChances: state.lastChances,
              lastChance: state.lastChance
          }}&gt;
              {children}
          &lt;/LastChanceContext.Provider&gt;
      )
  }
  
  export default LastChanceWrapper
  </code></pre>