import React, {Component} from 'react';
import blessed from 'blessed';
import {render} from '../src';
class RemovesChild extends Component {
constructor(props) {
super(props);
this.state = {renderChild: true};
setInterval(() => {
this.setState(state => ({renderChild: !state.renderChild}));
}, props.freq || 500);
}
render() {
const {renderChild} = this.state;
return (
{renderChild && (
I will be removed
)}
);
}
}
const screen = blessed.screen({
autoPadding: true,
smartCSR: true,
title: 'react-blessed box animation'
});
screen.key(['escape', 'q', 'C-c'], function(ch, key) {
return process.exit(0);
});
render(, screen, (inst) => console.log('Rendered RemovesChild!'));