mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
19 lines
540 B
JavaScript
19 lines
540 B
JavaScript
import React from 'react'
|
|
|
|
export default class Render extends React.Component {
|
|
state = {
|
|
style: { textAlign: "center" }
|
|
}
|
|
|
|
render(){
|
|
const { style } = this.state
|
|
const cambiarColor = (color) => { this.setState({ style: { color: color, ...style } }) }
|
|
return(
|
|
<div style={style} >
|
|
Current Style => { JSON.stringify(style) }<br />
|
|
<button onClick={() => { cambiarColor("green") }} > Update estilo </button>
|
|
</div>
|
|
)
|
|
}
|
|
}
|