Update to React 18
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { createContext, FC, useContext, useEffect, useState } from 'react';
|
||||
import React, { type FC, type PropsWithChildren, createContext, useContext, useEffect, useState } from 'react';
|
||||
|
||||
import type { WebConfig } from '../types/webConfig';
|
||||
import defaultConfig from '../config.json';
|
||||
@@ -7,7 +7,7 @@ import fetchLocal from '../utils/fetchLocal';
|
||||
export const WebConfigContext = createContext<WebConfig>(defaultConfig);
|
||||
export const useWebConfig = () => useContext(WebConfigContext);
|
||||
|
||||
export const WebConfigProvider: FC = ({ children }) => {
|
||||
export const WebConfigProvider: FC<PropsWithChildren<unknown>> = ({ children }) => {
|
||||
const [ config, setConfig ] = useState<WebConfig>(defaultConfig);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user