react#createContext JavaScript Examples
The following examples show how to use
react#createContext.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Context.jsx From roomie-frontend with MIT License | 7 votes |
Context = createContext()
Example #2
Source File: accounts.js From vpp with MIT License | 6 votes |
AccountsContext = createContext({
accounts: null,
storeAccounts: () => {
throw new Error('Accounts not yet ready.');
},
address: null,
storeAddress: () => {
throw new Error('Address not yet ready.');
},
keyring: null,
storeKeyring: () => {
throw new Error('Keyring not yet ready.');
},
})
Example #3
Source File: ResponsiveContext.js From react-context-responsive with MIT License | 6 votes |
ResponsiveContext = createContext({
isCalculated: false,
mediaType: 'xs',
lessThan: {},
greaterThan: {},
is: {},
orientation: null,
mobileBreakpoint: 'md',
})
Example #4
Source File: CaptureDetailContext.js From treetracker-admin-client with GNU Affero General Public License v3.0 | 6 votes |
CaptureDetailContext = createContext({
capture: null,
species: null,
tags: [],
getCaptureDetail: () => {},
getSpecies: () => {},
getTags: () => {},
reset: () => {},
})
Example #5
Source File: AppContext.js From bicara-hook with GNU General Public License v3.0 | 6 votes |
function AppContext(){
const LangContext = createContext();
const ThemeContext = createContext();
const LangProvider = (props) => {
const [lang, setLang] = useState("??");
const changeLang = e => setLang(e.target.value);
const langState = { lang, changeLang };
return (
<LangContext.Provider value={langState}>
{props.children}
</LangContext.Provider>
);
}
const ThemeProvider = (props) => {
const [theme, setTheme] = useState("light");
const changeTheme = e => setTheme(e.target.value);
const themeState = { theme, changeTheme };
return (
<ThemeContext.Provider value={themeState}>
{props.children}
</ThemeContext.Provider>
);
}
return {
LangContext,
LangProvider,
ThemeContext,
ThemeProvider
}
}
Example #6
Source File: state.js From stack-underflow with MIT License | 6 votes |
StateContext = createContext({
editValues: null,
notification: null,
darkMode: false,
setEditValues: (values) => {},
clearEdit: () => {},
notify: (message, severity, duration) => {},
clearNotif: () => {},
toggleDarkMode: () => {},
})
Example #7
Source File: Application.js From about-1hive with GNU General Public License v3.0 | 5 votes |
ApplicationContext = createContext({})
Example #8
Source File: Allowances.js From uniswap-v1-frontend with GNU General Public License v3.0 | 5 votes |
AllowancesContext = createContext()
Example #9
Source File: session.js From rsc-www with GNU Affero General Public License v3.0 | 5 votes |
SessionContext = createContext()
Example #10
Source File: DarkThemeProvider.jsx From bunk-manager-mern with MIT License | 5 votes |
DarkThemeContext = createContext(false)
Example #11
Source File: elementContext.js From Elemento with MIT License | 5 votes |
elementContext = createContext()
Example #12
Source File: DragWrapper.js From apps-base-schema with MIT License | 5 votes |
DragContext = createContext({handleTableDrag() {}})
Example #13
Source File: NotificationsProvider.js From tisn.app with GNU Affero General Public License v3.0 | 5 votes |
NotificationsContext = createContext()
Example #14
Source File: cartContext.js From Next.js-e-commerce-online-store with MIT License | 5 votes |
CartContext = createContext()
Example #15
Source File: api.js From vpp with MIT License | 5 votes |
ApiContext = createContext({
api: initialApi,
apiState: '',
createApi: () => {
throw new Error('Api not yet ready.');
},
})
Example #16
Source File: ThemeContext.js From viade_en1b with MIT License | 5 votes |
ThemeContext = createContext({
theme: themes.lightOrange,
setTheme: (theme) => {},
})
Example #17
Source File: InitialContext.js From front-end with MIT License | 5 votes |
InitialContext = createContext()
Example #18
Source File: UserContext.js From connect-4-online-multiplayer with MIT License | 5 votes |
UserContext = createContext()
Example #19
Source File: attribute.context.js From covid-tracker-material-ui-react with MIT License | 5 votes |
AttributeContext = createContext()
Example #20
Source File: InventoryContext.js From CyberStateRP with MIT License | 5 votes |
InventoryContext = createContext(null)
Example #21
Source File: DeviceContext.js From Encon-fe with MIT License | 5 votes |
DeviceContext = createContext()
Example #22
Source File: ProfileContext.js From workout-tracker-fe-pt with MIT License | 5 votes |
ProfileContext = createContext()
Example #23
Source File: context.js From react-starter-kit with Apache License 2.0 | 5 votes |
ConfigContext = createContext()
Example #24
Source File: map-context.js From website with Apache License 2.0 | 5 votes |
MapContext = createContext()
Example #25
Source File: Form.js From ponce-tournois-mario-kart with MIT License | 5 votes |
FormContext = createContext()
Example #26
Source File: Example2.js From Front-end-learning-to-organize-notes with MIT License | 5 votes |
CountContext = createContext()
Example #27
Source File: UserProvider.js From React-Messenger-App with MIT License | 5 votes |
UserContext = createContext({ user: null })
Example #28
Source File: Appcontext.js From Website with MIT License | 5 votes |
AppContext = createContext()
Example #29
Source File: AnimeContext.jsx From animeworldz with MIT License | 5 votes |
PopularAnimeContext = createContext()