Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Component extends React.Component {
- _bind(...methods) {
- methods.forEach((method) => this[method] = this[method].bind(this));
- }
- }
- class UserSettings extends Component {
- constructor() {
- super();
- this._bind("toggleSound", "toggleVibrate");
- }
- toggleSound() {
- console.log("Sound Toggle");
- }
- toggleVibrate() {
- }
- render() {
- return (
- <span>
- <ul className="links">
- <li onClick={this.toggleSound}>
- <a href="javascript:{}">Sound <i className={"right fa " + (false ? "fa-check-square-o" : "fa-square-o")}></i></a>
- </li>
- <li onClick={this.toggleVibrate}>
- <a href="javascript:{}">Vibration <i className={"right fa " + (false ? "fa-check-square-o" : "fa-square-o")}></i></a>
- </li>
- </ul>
- <a href="javascript:{}" onClick={this.toggleSound.bind(this)}>Test</a>
- </span>
- );
- }
- }
- ReactDOM.render(<UserSettings />, document.getElementById("nav"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement