import React from 'react' ; import { StateContext } from '../components/ContextProvider' ; export const useSettings = ( ) => { const context = React . useContext ( StateContext ) ; if ( context === undefined ) { throw new Error ( "You must use 'useSettings' hook inside ContextProvider" ) ; } return context ; } ;