Skip to content
This repository was archived by the owner on Mar 27, 2018. It is now read-only.

Commit 592650b

Browse files
committed
fix(components): remove deprecated prop types that were only used for Paragraphs
1 parent 47b1408 commit 592650b

File tree

4 files changed

+5
-23
lines changed

4 files changed

+5
-23
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"get-nested": "^4.0.0",
1414
"prop-types": "^15.5.10",
1515
"react-async-bootstrapper": "^1.1.2",
16-
"react-is-deprecated": "^0.1.2",
1716
"util-deprecate": "^1.0.2"
1817
},
1918
"peerDependencies": {

src/EntityListMapper.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React, { Fragment } from 'react';
22
import PropTypes from 'prop-types';
3-
import { deprecate } from 'react-is-deprecated';
43
import Entity from './EntityMapper';
54

6-
const EntityListMapper = ({ mapper, paragraphs, entities, page, Wrapper, entityWrapper, paragraphProps, entityProps, asyncMapper }) =>
7-
(entities || paragraphs).map((ref, index) => {
8-
const EntityWrapper = entityWrapper || Wrapper || Fragment;
5+
const EntityListMapper = ({ mapper, entities, entityWrapper, entityProps, asyncMapper }) =>
6+
entities.map((ref, index) => {
7+
const EntityWrapper = entityWrapper || Fragment;
98
const uuid = ref.target_uuid || ref;
109
return (
1110
<EntityWrapper key={uuid}>
@@ -14,7 +13,7 @@ const EntityListMapper = ({ mapper, paragraphs, entities, page, Wrapper, entityW
1413
index={index}
1514
mapper={mapper}
1615
asyncMapper={asyncMapper}
17-
entityProps={{ page, ...entityProps || paragraphProps }}
16+
entityProps={entityProps}
1817
/>
1918
</EntityWrapper>
2019
);
@@ -34,16 +33,10 @@ EntityListMapper.propTypes = {
3433
entityWrapper: PropTypes.element,
3534
entityProps: PropTypes.shape(),
3635
asyncMapper: PropTypes.bool,
37-
paragraphProps: deprecate(PropTypes.shape(), 'Warning: The prop "paragraphProps" is replaced by "entityProps".'),
38-
paragraphs: deprecate(PropTypes.arrayOf(PropTypes.shape()), 'Warning: The prop "paragraphs" is replaced by "entities".'),
39-
page: deprecate(PropTypes.shape(), 'Warning: The prop "page" is deprecated. Please use "entityProps={{ page }}" instead.'),
40-
Wrapper: deprecate(PropTypes.element, 'Warning: The prop "Wrapper" is replaced by "entityWrapper".'),
4136
};
4237

4338
EntityListMapper.defaultProps = {
44-
Wrapper: undefined,
4539
entityWrapper: undefined,
46-
paragraphProps: undefined,
4740
entityProps: undefined,
4841
asyncMapper: undefined,
4942
};

src/EntityMapper.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
33
import getNested from 'get-nested';
4-
import { deprecate } from 'react-is-deprecated';
54
import site from './site';
65

76
class EntityMapper extends Component {
@@ -118,7 +117,7 @@ class EntityMapper extends Component {
118117
}
119118

120119
render() {
121-
const { index, paragraphProps } = this.props;
120+
const { index } = this.props;
122121
const { uuid, entityComponentSymbol, entityProps } = this.state;
123122

124123
const entity = site.getData(uuid);
@@ -135,7 +134,6 @@ class EntityMapper extends Component {
135134
paragraph={entity}
136135
entity={entity}
137136
index={index}
138-
{...paragraphProps}
139137
{...entityProps}
140138
/>
141139
);
@@ -149,17 +147,13 @@ EntityMapper.propTypes = {
149147
]).isRequired,
150148
asyncMapper: PropTypes.bool,
151149
uuid: PropTypes.string.isRequired,
152-
page: deprecate(PropTypes.shape(), 'Warning: The prop "page" is deprecated. Please use "entityProps={{ page }}" instead.'),
153150
index: PropTypes.number,
154151
entityProps: PropTypes.shape(),
155-
paragraphProps: deprecate(PropTypes.shape(), 'Warning: The prop "paragraphProps" is replaced by "entityProps".'),
156152
};
157153

158154
EntityMapper.defaultProps = {
159155
asyncMapper: false,
160-
page: undefined,
161156
entityProps: {},
162-
paragraphProps: undefined,
163157
index: 0,
164158
};
165159

yarn.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3733,10 +3733,6 @@ react-dom@^16.2.0:
37333733
object-assign "^4.1.1"
37343734
prop-types "^15.6.0"
37353735

3736-
react-is-deprecated@^0.1.2:
3737-
version "0.1.2"
3738-
resolved "https://registry.yarnpkg.com/react-is-deprecated/-/react-is-deprecated-0.1.2.tgz#301148f86ea428fe8e673eca7a372160b7579dbd"
3739-
37403736
react-test-renderer@^16.2.0:
37413737
version "16.2.0"
37423738
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.2.0.tgz#bddf259a6b8fcd8555f012afc8eacc238872a211"

0 commit comments

Comments
 (0)