Last active
August 10, 2018 02:16
-
-
Save wnqueiroz/a8281150324bb8b9afd5827b975c7e5d to your computer and use it in GitHub Desktop.
React Context: App.jsx with loading context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, Fragment } from 'react' | |
import Departments from './components/Departments' | |
import Users from './components/Users' | |
import './index.css' | |
const LoadingContext = React.createContext({ | |
loading: false, | |
message: null, | |
showLoading: message => { }, | |
hideLoading: () => { } | |
}) | |
class App extends Component { | |
render() { | |
return ( | |
<Fragment> | |
<Users /> | |
<Departments /> | |
</Fragment> | |
) | |
} | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment