GoConqr has a new look! Let us know what you think.

Notes

Untitled

Akaki Khotcholava English 1 page

Content of the notes (1)

Page 1

import React, { Component } from 'react';

class Counter extends Component {

state = {

count: 1,

imgUrl: 'https://picsum.photos/200',

defaultText: 'Image title'

};

render () {

let classes = "badge m-2 badge-";

classes += this.state.count === 0 ? "warning" : "primary";

return(

<React.Fragment>

<div>

<img src={this.state.imgUrl} alt={this.state.defaultText}/>

<span style={this.styles} className={classes}>{this.formatCount()}</span>

<button onClick={this.formatCount()}>Increment</button>

</div>

</React.Fragment>

)

}

formatCount() {

const {count} = this.state;

return count === 0 ? "Zero" : count;

}

}

export default Counter;

Information

Description
Note on Untitled, created by Akaki Khotcholava on 12/12/2018.
Views
23
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?