Skip to content

Instantly share code, notes, and snippets.

View davidrosenlund's full-sized avatar

David Rosenlund davidrosenlund

View GitHub Profile
P A R E N T App.js
######################
class App extends Component {
state = {
casinos: [],
isbonus: false,
}
callbackFunction = (childData) => { this.setState({isbonus: childData})};
Parent App.js
########################
const BonusContext = React.createContext(false);
class App extends Component {
static contextType = BonusContext;
render() {
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,
}