Skip to content

Commit 0956c19

Browse files
author
Matthew R. Elliott
committed
Merge pull request #5 from TechniqueSoftware/release/0.3.0
Release v0.3.0
2 parents 2d50edc + 03e0f5b commit 0956c19

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ JSX is not a dependency for react-json-schema.
66

77
For a quick reference, you can jump to [full example](#putting-it-all-together).
88

9+
For 0.3.0+, you must use React 0.14.0+. You may use 0.2.0 for older versions.
10+
911
### Documentation
1012

1113
#### Schema
@@ -73,14 +75,13 @@ Use `parseSchema` to render React elements. It returns the root node. Note that
7375

7476
Example (ES6)
7577
```js
76-
/* If using ReactDOM (0.14+), else use React */
7778
ReactDOM.render(contactForm.parseSchema(schema),
7879
document.getElementById('contact-form'));
7980
```
8081

8182
##### Rendering
8283

83-
Also note react-json-schema also does not perform any rendering, so the method in which you want to render is up to you. For example, you can use ReactDOMServer.render, ReactDOM.renderToString, etc. if you'd like.
84+
Also note react-json-schema does not perform any rendering, so the method in which you want to render is up to you. For example, you can use ReactDOMServer.render, ReactDOM.renderToString, etc. if you'd like.
8485

8586
#### Putting it All Together
8687

demo/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import ReactDOM from 'react-dom';
22
import ContactForm from './components/ContactForm';
33
import StringField from './components/StringField';
44
import CheckboxField from './components/CheckboxField';
@@ -13,7 +13,7 @@ const welcomeSchema = {
1313
};
1414

1515
const welcomeBanner = new ReactJsonSchema();
16-
React.render(welcomeBanner.parseSchema(welcomeSchema), document.getElementById('welcome-banner'));
16+
ReactDOM.render(welcomeBanner.parseSchema(welcomeSchema), document.getElementById('welcome-banner'));
1717

1818
const formSchema = {
1919
'component': 'ContactForm',
@@ -43,4 +43,4 @@ const componentMap = { ContactForm, StringField, CheckboxField };
4343
const contactForm = new ReactJsonSchema();
4444
contactForm.setComponentMap(componentMap);
4545

46-
React.render(contactForm.parseSchema(formSchema), document.getElementById('json-react-schema'));
46+
ReactDOM.render(contactForm.parseSchema(formSchema), document.getElementById('json-react-schema'));

dist/react-json-schema.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
1212

1313
var _react = require('react');
1414

15-
var _node_modulesReactLibReactDOM = require('../node_modules/react/lib/ReactDOM');
15+
var _node_modulesReactLibReactDOMFactories = require('../node_modules/react/lib/ReactDOMFactories');
1616

17-
var _node_modulesReactLibReactDOM2 = _interopRequireDefault(_node_modulesReactLibReactDOM);
17+
var _node_modulesReactLibReactDOMFactories2 = _interopRequireDefault(_node_modulesReactLibReactDOMFactories);
1818

1919
var _lodash = require('lodash');
2020

@@ -67,7 +67,7 @@ var ReactJsonSchema = (function () {
6767
Component = schema.component;
6868
} else if (_componentMap && _componentMap[schema.component]) {
6969
Component = _componentMap[schema.component];
70-
} else if ((0, _lodash.has)(_node_modulesReactLibReactDOM2['default'], schema.component)) {
70+
} else if ((0, _lodash.has)(_node_modulesReactLibReactDOMFactories2['default'], schema.component)) {
7171
Component = schema.component;
7272
}
7373
} else {

dist/react-json-schema.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ReactJsonSchema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createElement } from 'react';
2-
import ReactDOM from '../node_modules/react/lib/ReactDOM';
2+
import ReactDOMFactories from '../node_modules/react/lib/ReactDOMFactories';
33
import { isFunction, isArray, forEach, omit, clone, has, isObject, isString } from 'lodash';
44

55
let _componentMap = null;
@@ -41,7 +41,7 @@ export default class ReactJsonSchema {
4141
Component = schema.component;
4242
} else if (_componentMap && _componentMap[schema.component]) {
4343
Component = _componentMap[schema.component];
44-
} else if (has(ReactDOM, schema.component)) {
44+
} else if (has(ReactDOMFactories, schema.component)) {
4545
Component = schema.component;
4646
}
4747
} else {

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-json-schema",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Write component schema in JSON; parse to create react elements.",
55
"keywords": [
66
"react",
@@ -13,8 +13,8 @@
1313
"url": "http://elliottisonfire.com"
1414
},
1515
"repository": {
16-
"type" : "git",
17-
"url" : "https://github.com/TechniqueSoftware/react-json-schema"
16+
"type": "git",
17+
"url": "https://github.com/TechniqueSoftware/react-json-schema"
1818
},
1919
"license": "Apache-2.0",
2020
"bugs": {
@@ -34,7 +34,7 @@
3434
],
3535
"dependencies": {
3636
"lodash": "^3.10.1",
37-
"react": "^0.13.3"
37+
"react": "^0.14.2"
3838
},
3939
"devDependencies": {
4040
"babel-core": "^5.8.25",
@@ -48,7 +48,8 @@
4848
"jasmine": "^2.3.2",
4949
"jsx-loader": "^0.13.2",
5050
"path": "^0.12.7",
51-
"react-bootstrap": "^0.25.2",
51+
"react-bootstrap": "^0.27.3",
52+
"react-dom": "^0.14.2",
5253
"uglify-js": "^2.4.24",
5354
"webpack": "^1.12.2",
5455
"webpack-dev-server": "^1.12.0"

0 commit comments

Comments
 (0)