Advertisement
Guest User

JavaScript

a guest
Oct 14th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. class MinecraftCodeObfuscated extends React.Component {
  2. constructor (props) {
  3. super(props);
  4.  
  5. this.state = {
  6. value: this.props.value
  7. }
  8.  
  9. this.value = '';
  10. this.intervals = [];
  11. }
  12.  
  13. componentDidMount () {
  14. this.replaceChar(0)
  15. }
  16.  
  17. componentWillUnmount () {
  18. this.intervals.forEach(interval => {
  19. clearInterval(interval)
  20. });
  21. }
  22.  
  23. randomString (len) {
  24. let string = "";
  25. for (let i =0; i < len; i++) {
  26. string += String.fromCharCode(rand(64,95));
  27. }
  28. return string;
  29. }
  30.  
  31. replaceChar(i) {
  32. this.value[i] = this.randomString(1); // ВОТ ТУТ БЛЯТСКАЯ ОШИБКА мол this.value is read only!!!!
  33. this.setState({
  34. value: this.value
  35. });
  36. }
  37.  
  38. render () {
  39. return (<span className={this.props.classnames}>{this.state.value}</span>)
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement