Click in order · JavaScript and React course · Module 4: Context API and useReducer
Creating a Context
Arrange the code for creating a galactic context:
Items to click
- import React, { createContext } from 'react';
- });
- const GalacticContext = createContext({
- ships: [],
- energy: 100
You can check the correct answer by solving this task in the CodeWorlds game.