You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Taken from the React Hooks course in the Context API lessons-
LocalContext.js will create the "LocaleContext" const - set it as default export - then import it from itself ( import LocaleContext from ./LocalContext) ? It looks like there is missing lines in the text?
// LocaleContext.js
import React from "react";
const LocaleContext = React.createContext();
export default LocaleContext;
import React from "react";
import LocaleContext from "./LocaleContext";
export default function App() {
const [locale, setLocale] = React.useState("en");
return (
<LocaleContext.Provider value={locale}>
</LocaleContext.Provider>
);
}
The text was updated successfully, but these errors were encountered:
Taken from the React Hooks course in the Context API lessons-
LocalContext.js will create the "LocaleContext" const - set it as default export - then import it from itself ( import LocaleContext from ./LocalContext) ? It looks like there is missing lines in the text?
// LocaleContext.js
import React from "react";
const LocaleContext = React.createContext();
export default LocaleContext;
import React from "react";
import LocaleContext from "./LocaleContext";
export default function App() {
const [locale, setLocale] = React.useState("en");
return (
<LocaleContext.Provider value={locale}>
</LocaleContext.Provider>
);
}
The text was updated successfully, but these errors were encountered: