GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Notizen

Ohne Titel

Akaki Khotcholava Englisch 1 Seite

Inhalt der Notizen (1)

Seite 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;

Informationen

Beschreibung
Notiz am Ohne Titel, erstellt von Akaki Khotcholava am 12/12/2018.
Erstellt von
Akaki Khotcholava
Aufrufe
23
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck