Created
January 30, 2018 19:53
-
-
Save marensas/fa0f1b4ef33f9b0b6131a4baec9e9c20 to your computer and use it in GitHub Desktop.
Komponentas
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 } from 'react'; | |
class Komponentas extends Component { | |
constructor(props) { | |
super(props); | |
// mini duombaze | |
this.state = { | |
data: 'informacija' | |
} | |
} | |
handleClick = () => { | |
//siunciame duomenis | |
this.setState({ data: 'pakeista info' }); | |
} | |
render() { | |
// gauname duomenis | |
const info = this.state.data; | |
return ( | |
<div> | |
<p>{info}</p> | |
<button onClick={() => this.handleClick}>Push the button</button> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment