Skip to content

Commit 2afd55f

Browse files
rom10n1k0
authored andcommitted
1 parent 316258e commit 2afd55f

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/components/fields/ArrayField.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ import CheckboxesWidget from "./../widgets/CheckboxesWidget";
2020

2121
function ArrayFieldTitle({TitleField, idSchema, title, required}) {
2222
if (!title) {
23-
return null;
23+
// See #312: Ensure compatibility with old versions of React.
24+
return <div />;
2425
}
2526
const id = `${idSchema.$id}__title`;
2627
return <TitleField id={id} title={title} required={required} />;
2728
}
2829

2930
function ArrayFieldDescription({DescriptionField, idSchema, description}) {
3031
if (!description) {
31-
return null;
32+
// See #312: Ensure compatibility with old versions of React.
33+
return <div />;
3234
}
3335
const id = `${idSchema.$id}__description`;
3436
return <DescriptionField id={id} description={description} />;

src/components/fields/DescriptionField.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import React, {PropTypes} from "react";
33
function DescriptionField(props) {
44
const {id, description} = props;
55
if (!description) {
6-
return null;
6+
// See #312: Ensure compatibility with old versions of React.
7+
return <div />;
78
}
89
if (typeof description === "string") {
910
return <p id={id} className="field-description">{description}</p>;

src/components/fields/SchemaField.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function getFieldComponent(schema, uiSchema, fields) {
3838
function Label(props) {
3939
const {label, required, id} = props;
4040
if (!label) {
41-
return null;
41+
// See #312: Ensure compatibility with old versions of React.
42+
return <div />;
4243
}
4344
return (
4445
<label className="control-label" htmlFor={id}>
@@ -50,7 +51,8 @@ function Label(props) {
5051
function Help(props) {
5152
const {help} = props;
5253
if (!help) {
53-
return null;
54+
// See #312: Ensure compatibility with old versions of React.
55+
return <div />;
5456
}
5557
if (typeof help === "string") {
5658
return <p className="help-block">{help}</p>;
@@ -61,7 +63,7 @@ function Help(props) {
6163
function ErrorList(props) {
6264
const {errors = []} = props;
6365
if (errors.length === 0) {
64-
return null;
66+
return <div />;
6567
}
6668
return (
6769
<div>
@@ -137,6 +139,7 @@ function SchemaField(props) {
137139
const autofocus = Boolean(props.autofocus || uiSchema["ui:autofocus"]);
138140

139141
if (Object.keys(schema).length === 0) {
142+
// See #312: Ensure compatibility with old versions of React.
140143
return <div />;
141144
}
142145

0 commit comments

Comments
 (0)