-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Trying to use the following:
import React, {Component, PropTypes} from 'react';
import Form from "react-jsonschema-form";
const schema = {
title: "Todo",
type: "object",
required: ["title"],
properties: {
title: {type: "string", title: "Title", default: "A new task"},
done: {type: "boolean", title: "Done?", default: false}
}
};
class MyForm extends Component {
static propTypes = {}
constructor(props) {
super(props);
}
onFormChange() {}
onFormSubmit() {}
onFormError() {}
render() {
return (
<Form schema={schema}
onChange={this.onFormChange}
onSubmit={this.onFormSubmit}
onError={this.onFormError} />
);
}
}
export default MyForm;
but getting this error: Uncaught Error: Cannot find module './components/fields/SchemaField'
Inspecting the code, it appears the load
helper is unable to find the modules:
var load = function load(prefix, arr) {
return arr.reduce(function (obj, comp) {
obj[comp] = require("./components/" + prefix + "/" + comp).default;
return obj;
}, {});
};
Is this library only intended to work server-side?
Metadata
Metadata
Assignees
Labels
No labels