This file contains hidden or 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 { withRouter, Switch, Route, NavLink, BrowserRouter } from "react-router-dom"; | |
| import './App.scss'; | |
| class App extends Component { | |
| state = { | |
| casinos: [], | |
| isbonus: false, | |
| } |
This file contains hidden or 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
| Parent App.js | |
| ######################## | |
| const BonusContext = React.createContext(false); | |
| class App extends Component { | |
| static contextType = BonusContext; | |
| render() { |
This file contains hidden or 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
| P A R E N T App.js | |
| ###################### | |
| class App extends Component { | |
| state = { | |
| casinos: [], | |
| isbonus: false, | |
| } | |
| callbackFunction = (childData) => { this.setState({isbonus: childData})}; |