import React , { useState } from "react" ; export const DataContext = React . createContext ( { } ) ; const DataProviders = ( { children } ) => { const [ database , setData ] = useState ( "test" ) ; const dataHandler = ( ref ) => { setData ( ref ) ; } ; return ( < DataContext . Provider value = { { database , dataHandler , } } > { children } < /DataContext.Provider>); } ; export default DataProviders ;