1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

deprecate renderPortal

This commit is contained in:
Ian Storm Taylor 2018-08-22 14:11:20 -07:00
parent 357239dbec
commit b8ed582ba4
2 changed files with 9 additions and 0 deletions

View File

@ -73,6 +73,8 @@ const selection = document.createSelection({
**The `Node.createChildren` static method is deprecated.** This was just an alias for `Node.createList` and wasn't necessary. You can use `Node.createList` going forward for the same effect.
**The `renderPortal` property of plugins is deprecated.** This allows `slate-react` to be slightly slimmer, since this behavior can be handled in React 16 with the new `<React.Fragment>` using the `renderEditor` property instead, in a way that offers more control over the portal behavior.
---
### `0.38.0` — August 21, 2018

View File

@ -1,4 +1,5 @@
import { Record } from 'immutable'
import logger from 'slate-dev-logger'
import MODEL_TYPES from '../constants/model-types'
import memoize from '../utils/memoize'
@ -128,6 +129,12 @@ class Stack extends Record(DEFAULTS) {
const plugins = this.getPluginsWith(property)
return plugins.reduceRight((children, plugin) => {
if (!plugin[property]) return children
logger.deprecate(
'0.39.0',
'The `renderPortal` property of plugins is deprecated, please use `renderEditor` with a `<React.Fragment>` in React 16 instead.'
)
const ret = plugin[property](props, ...args)
if (ret == null) return children
props.children = ret