{
componentDidMount() {
enableGlobalBlurring(this.props.blurAllCells);
this.createFallbackCell();
}
componentDidUpdate() {
this.createFallbackCell();
}
componentWillUnmount() {
disableGlobalBlurring(this.props.blurAllCells);
}
createFallbackCell = () => {
const { node, defaultPlugin, id } = this.props;
if (!node) {
return;
}
const { cells = [] } = node;
if (cells.length === 0) {
this.props.createFallbackCell(new ContentPlugin(defaultPlugin), id);
}
}
render() {
const { id, containerWidth, containerHeight, node } = this.props;
if (!node) {
return null;
}
const { cells = [] } = node;
return (
{cells.map((c: string) => (
|
))}
);
}
}
const mapStateToProps = createStructuredSelector({ node: purifiedEditable });
const mapDispatchToProps = { blurAllCells, createFallbackCell };
export default dimensions()(
connect(
mapStateToProps,
mapDispatchToProps
)(Inner)
);