File "app-context.js"
Full Path: /home/warrior1/public_html/plugins/elementor/app/assets/js/app-context.js
File size: 468 bytes
MIME-type: text/x-java
Charset: utf-8
import { useState } from 'react';
export const AppContext = React.createContext();
export default function AppProvider( props ) {
const initialState = {
isDarkMode: document.body.classList.contains( `eps-theme-dark` ),
},
[ state, setState ] = useState( initialState );
return (
<AppContext.Provider value={ { state, setState } }>
{ props.children }
</AppContext.Provider>
);
}
AppProvider.propTypes = {
children: PropTypes.object.isRequired,
};