From cf1866f850b483c3abac1131f5a26eecefbcd2c8 Mon Sep 17 00:00:00 2001 From: Stepan Vanzuriak Date: Tue, 11 Dec 2018 20:32:34 +0200 Subject: [PATCH] React JSX eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --- e.jsx | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 e.jsx diff --git a/e.jsx b/e.jsx new file mode 100644 index 0000000..0555b61 --- /dev/null +++ b/e.jsx @@ -0,0 +1,33 @@ +import React, { Component } from 'react'; + +class E extends Component { + constructor(props) { + super(props); + + this.state = { + e: 0, + }; + + this.timer = this.timer.bind(this); + } + + componentDidMount() { + const eId = setInterval(this.timer, 10); + this.setState({ eInterval: eId }); + } + + componentWillUnmount() { + clearInterval(this.state.eInterval); + } + + timer() { + this.setState({ e: this.state.e + 1 }); + } + + render() { + const e = Array(this.state.e).fill(

e

); + return e; + } +} + +export default E;