From 2ad73d73e5917114b67c627cd842be686b520717 Mon Sep 17 00:00:00 2001 From: David Gertmenian-Wong Date: Tue, 11 Dec 2018 12:54:26 -0800 Subject: [PATCH] Update Placeholder to be compatible with older versions of React (#2491) * Make `placeholder` element compatible with older versions of React `React.Fragment` is only available in react >= 16.2, which does not meet the dependency requirements specified by the package (react >= 0.14.0). Updates from `React.Fragment` -> `span` to provide coverage for older versions of react. * Update `slate-react` placeholder test case --- packages/slate-react-placeholder/src/index.js | 4 ++-- .../single-block-with-single-empty-text.js | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/slate-react-placeholder/src/index.js b/packages/slate-react-placeholder/src/index.js index 8383d0610..983a1abe9 100644 --- a/packages/slate-react-placeholder/src/index.js +++ b/packages/slate-react-placeholder/src/index.js @@ -70,12 +70,12 @@ function SlateReactPlaceholder(options = {}) { } return ( - + {placeholder} {children} - + ) } diff --git a/packages/slate-react/test/rendering/fixtures/placeholder/single-block-with-single-empty-text.js b/packages/slate-react/test/rendering/fixtures/placeholder/single-block-with-single-empty-text.js index 5ca925227..47f1bbfb2 100644 --- a/packages/slate-react/test/rendering/fixtures/placeholder/single-block-with-single-empty-text.js +++ b/packages/slate-react/test/rendering/fixtures/placeholder/single-block-with-single-empty-text.js @@ -21,11 +21,13 @@ export const output = `
- - placeholder text - - -
+ + + placeholder text + + +
+