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:
@@ -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 })
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user