Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MinecraftCodeObfuscated extends React.Component {
- constructor (props) {
- super(props);
- this.state = {
- value: this.props.value
- }
- this.value = '';
- this.intervals = [];
- }
- componentDidMount () {
- this.replaceChar(0)
- }
- componentWillUnmount () {
- this.intervals.forEach(interval => {
- clearInterval(interval)
- });
- }
- randomString (len) {
- let string = "";
- for (let i =0; i < len; i++) {
- string += String.fromCharCode(rand(64,95));
- }
- return string;
- }
- replaceChar(i) {
- this.value[i] = this.randomString(1); // ВОТ ТУТ БЛЯТСКАЯ ОШИБКА мол this.value is read only!!!!
- this.setState({
- value: this.value
- });
- }
- render () {
- return (<span className={this.props.classnames}>{this.state.value}</span>)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement