Brandon Presley
8461f86e88
I find it easier to import hooks by useX instead of useContext(X). Like how the navigation library is just useNavigation
12 lines
229 B
TypeScript
12 lines
229 B
TypeScript
import React, {useContext} from 'react';
|
|
|
|
export const Color = React.createContext({
|
|
color: '',
|
|
setColor: (_value: string) => {},
|
|
});
|
|
|
|
export const useColor = () => {
|
|
const context = useContext(Color);
|
|
return context;
|
|
};
|