This repository has been archived on 2025-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
lcm-potty-chart/contexts/dateContext.tsx
2021-11-30 20:12:01 -06:00

26 lines
540 B
TypeScript

import * as React from "react";
import { useState } from "react";
// TODO: import types
const CalenderContext = React.createContext<any | null>(null);
function CalenderContextProvider({
children,
}: {
children: React.ReactNode;
}): React.ReactElement | null {
const [today] = useState<Date>(new Date());
const dateProviderValues = {
today,
};
return (
<CalenderContext.Provider value={dateProviderValues}>
{children}
</CalenderContext.Provider>
);
}
export { CalenderContextProvider, CalenderContext };