how to use a js class in react
class App extends Component {
constructor() {
super()
this.state = {
name: "Sally",
age: 13
}
}
render() {
return (
<div>
<h1>{this.state.name}</h1>
<h3>{this.state.age} years old</h3>
</div>
)
}
}class Developer { constructor(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } getName() { return this.firstname + ' ' + this.lastname; }} class ReactDeveloper extends Developer { getJob() { return 'React Developer'; }} var me = new ReactDeveloper('Robin', 'Wieruch'); console.log(me.getName());console.log(me.getJob());
Also in JavaScript:
- gatsbyjs shop flotiq
- react native flatlist pull to refresh
- disable long press on chrome
- How to abreviate digits in js
- Node Sass could not find a binding for your current environment
- get and set es6
- react native header
- how to do radio button validation in jquery
- angular mouseenter
- call function with id javascript
- in select option how to make one default in angular
- add javascript keyup on input
- include partials ejs
- render react in blaze
- document ready js
- array sort by key javascript
- memento database javascript list
- angular how to get previous state
- clear all intervals javascript
- javascript send post
- javascript exeit from loop
- remove floating point javascript
- js get last array element
- vue watch deep