Skip to content

Instantly share code, notes, and snippets.

View suhas86's full-sized avatar

Suhas S Murthy suhas86

View GitHub Profile
import React, { Component, createContext } from 'react'
type teamState = {
team:string
}
export const TeamContext = createContext<{team:string,changeTeam:any}>({team:"rcb",changeTeam:null})
class TeamProvider extends Component<{},teamState> {
constructor(props:{}){
super(props);
this.changeTeam = this.changeTeam.bind(this)
import React, { Component, createContext } from 'react'
type teamState = {
team:string
}
export const TeamContext = createContext<{team:string,changeTeam:any}>({team:"rcb",changeTeam:null})
class TeamProvider extends Component<{},teamState> {
constructor(props:{}){
super(props);
this.changeTeam = this.changeTeam.bind(this)
import React, { Component, createContext } from "react";
type themeState = {
isDarkMode: boolean;
toggleTheme: any;
};
export const ThemeContext = createContext<themeState>({
isDarkMode: false,
toggleTheme: null,