Skip to content

Instantly share code, notes, and snippets.

@wnqueiroz
Last active August 10, 2018 02:16
Show Gist options
  • Save wnqueiroz/a8281150324bb8b9afd5827b975c7e5d to your computer and use it in GitHub Desktop.
Save wnqueiroz/a8281150324bb8b9afd5827b975c7e5d to your computer and use it in GitHub Desktop.
React Context: App.jsx with loading context
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