Created
October 31, 2018 10:36
-
-
Save theham3d/594542a90061eea05382a8fef6eaaa49 to your computer and use it in GitHub Desktop.
rcContextType
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 } from 'react'; | |
import { AppContext } from './App'; | |
class MyComponent extends Component { | |
componentDidMount() { | |
let value = this.context; | |
/* و قص علی هذا */ | |
} | |
componentDidUpdate() { | |
let value = this.context; | |
/* و قص علی هذا */ | |
} | |
componentWillUnmount() { | |
let value = this.context; | |
/* و قص علی هذا */ | |
} | |
render() { | |
let value = this.context; | |
return <h1>{value}</h1>; | |
} | |
} | |
MyComponent.contextType = AppContext; | |
export default MyComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment