Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Description

Note on Untitled, created by Akaki Khotcholava on 12/12/2018.
Akaki Khotcholava
Note by Akaki Khotcholava, updated more than 1 year ago
Akaki Khotcholava
Created by Akaki Khotcholava over 6 years ago
2
0
1 2 3 4 5 (0)

Resource summary

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;

Show full summary Hide full summary

0 comments

There are no comments, be the first and leave one below:

Similar

Historical Development of Computer Languages
Shannon Anderson-Rush
Useful String Methods
Shannon Anderson-Rush
Flvs foundations of programming dba 2
mariaha vassar
Python Quiz
karljmurphy
computer systems and programming quiz
Molly Batch
Think Python
tsilvo2001
C Programming
Miki Rana
Generations of Programming Languages
Balikkoftesi
Mapa Conceptual - Arreglos
ciroivan94