andreypopp / andreypopp/react-quickstart

How to use react-forms with react-quickstart?

Đang mở
#22 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
367
Fork
41
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hey People,

I try to incorporate the getting started example from react-forms into this project structure
But then I get this syntax error.

node_modules/react-forms/lib/index.js:30
FormMixin, FormContextMixin, FormElementMixin,
^
SyntaxError: Unexpected token ,
at Module._compile (module.js:439:25)
at Object.require.extensions.(anonymous function) [as .js](/home/djan/dev/react-quickstart/node_modules/node-jsx/index.js:26:12)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/djan/dev/react-quickstart/pages/main.js:8:18)
at Module._compile (module.js:456:26)
at Object.require.extensions.(anonymous function) [as .js](/home/djan/dev/react-quickstart/node_modules/node-jsx/index.js:26:12)
at Module.load (module.js:356:32)
Program node server.js exited with code 8

Starting child process with 'node server.js'

Here my code:

``` javascript

var React = require('react');
var Schema = ReactForms.schema.Schema;
var Property = ReactForms.schema.Property;
var Form = ReactForms.Form;

var schema = (

.
.
.

);

var MainPage = React.createClass({

render: function() {
. return (
. .


. . .

. . . .

. . . . .

. . . . . .
. . . . .

. . . .

. . . .

Hello, anonymous!


. . . . .
. . . . .
. . .

. .

. );
```

To be complete, here is also my package.json.

``` javascript
{
name: react-quickstart,
version: 0.0.0,
description: React project,
main: ./server.js,
browser: ./client.js,
browserify: {
. transform: [
. . [reactify, {harmony: true}]
. ]
},
dependencies: {
. react: 0.11.0,
. react-forms:0.6.3,
. react-async: 1.0.2,
. react-router-component: 0.22.0,
. react-bootstrap:0.12.0,
. node-jsx: ~0.10.0,
. express: ~4.9.0,
. body-parser:1.9.1,
. less-middleware: 1.0.4,
. errorhandler: 1.1.1,
. connect-flash:0.1.1,
. passport:0.2.1,
. superagent: ~0.18.0,
. fibers: ~1.0.1
},
devDependencies: {
. reactify: ~0.13.1,
. envify: ~1.2.0,
. browserify: ~3.44.2,
. connect-browserify: ~2.0.1,
. uglify-js: ~2.4.13,
. supervisor: ~0.6.0
},
scripts: {
. test: echo \"Error: no test specified\" && exit 1,
. start: supervisor -i node_modules -e js,jsx server.js,
. build: NODE_ENV=production browserify ./ | uglifyjs -cm 2>/dev/null > ./assets/bundle.js,
. start-prod: NODE_ENV=production node server.js,
. clean: rm -f ./assets/bundle.js
},
author: "",
license: MIT
}
```

Can you help me? I do not see what's wrong.

Best regards
Jan

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.