1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 17:23:07 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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