1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-13 18:53:59 +02:00

Add 3 lifecycle event handlers (#2833)

This commit is contained in:
Sunny Hirai
2019-05-27 15:04:59 -07:00
committed by GitHub
parent 80212943cc
commit 2ec21e7fc4

View File

@@ -158,6 +158,8 @@ class Content extends React.Component {
}
this.updateSelection()
this.props.onEvent('onComponentDidMount', { target: this.ref.current })
}
/**
@@ -180,6 +182,8 @@ class Content extends React.Component {
this.handlers.onBeforeInput
)
}
this.props.onEvent('onComponentWillUnmount', { target: this.ref.current })
}
/**
@@ -188,7 +192,10 @@ class Content extends React.Component {
componentDidUpdate() {
debug.update('componentDidUpdate')
this.updateSelection()
this.props.onEvent('onComponentDidUpdate', { target: this.ref.current })
}
/**