andreypopp / andreypopp/react-quickstart

How to use react-forms with react-quickstart?

未关闭
#22 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
367
派生
41
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。