Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. export default class Ecran1_Tactile extends React.Component {
  2.  
  3. //setting state
  4.  
  5. constructor(props) {
  6. super(props)
  7.  
  8. this.state = {
  9. opacity: 0,
  10. click: 0,
  11. }
  12. }
  13.  
  14. //My navigation after 4 clicks
  15.  
  16. _displayScreen = () => {
  17. if(this.state.click === 4){
  18. this.props.navigation.navigate('Ecran2_Tactile')
  19. }
  20. }
  21.  
  22. //trying to reset state
  23.  
  24. componentWillUnmount(){
  25. this.setState({click: 0})
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement