// es6 new
import React { Component } from 'react';
import styles from "./style.css";
class XyzComponent extends Component {
constructor(props) {
super(props);
this.methods = this.methods.bind(this);
this.focus = this.focus.bind(this);
}
render() {
// Use the `ref` callback to store a reference to the text input DOM
// element in an instance field (for example, this.textInput).
return (
<div>
<input
type="text"
ref={(input) => { this.textInput = input; }}
/>
<input
type="button"
value="Focus the text input"
onClick={this.focus}
/>
</div>
);
}
}
export default XyzComponent
Last active
February 19, 2020 16:07
-
-
Save xgqfrms-GitHub/0a02e84d25cfeeb60d3c71e2a8ff1e91 to your computer and use it in GitHub Desktop.
react es6 skeleton jsx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/dominiek/app-skeleton/blob/master/src/components/common/ItemsList.jsx