update react scripts dependency (#255)
* Move "dependencies" close to "devDependencies" Makes it easier to have a quick overview * Upgrade "react-scripts" to latest version With new versions of node (> v16) the build scripts fails with the following error "error:0308010C:digital envelope routines::unsupported" * Upgrade "react-scripts" to v5 - Fix import * Upgrade "eslint" dependencies The latest version of "react-scripts" uses eslint v8 causing the following error "... ERROR in Plugin "react" was conflicted between ".eslintrc.js" >> eslint-config-airbnb ..." * Upgrade "eslint" dependencies - Allow nested components as props * Upgrade "eslint" dependencies - Fix lint issues
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import LibraryOptionsContext, { DefaultLibraryOptions } from 'components/context/LibraryOptionsContext';
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import { LibraryOptions } from 'typings';
|
||||
|
||||
@@ -17,7 +17,9 @@ interface IProps {
|
||||
const LibraryOptionsContextProvider: React.FC<IProps> = ({ children }) => {
|
||||
const [options, setOptions] = useLocalStorage<LibraryOptions>('libraryOptions', DefaultLibraryOptions);
|
||||
|
||||
return <LibraryOptionsContext.Provider value={{ options, setOptions }}>{children}</LibraryOptionsContext.Provider>;
|
||||
const value = useMemo(() => ({ options, setOptions }), [options, setOptions]);
|
||||
|
||||
return <LibraryOptionsContext.Provider value={value}>{children}</LibraryOptionsContext.Provider>;
|
||||
};
|
||||
|
||||
export default LibraryOptionsContextProvider;
|
||||
|
||||
Reference in New Issue
Block a user