AppliedMathematicsANU / plexus-form

A dynamic form component for react using JSON-Schema.
MIT License
134 stars 31 forks source link

Example in README.md throws error #41

Open Reggino opened 9 years ago

Reggino commented 9 years ago

Hi,

Running react 0.13.3, copy and paste from the "Minimal example" in README.md throws the following error...

TypeError: Cannot read property 'find' of undefined
    at fullOrdering (plexus-form.js:923)
    at Object.types.object (plexus-form.js:904)
    at Object.module.exports [as make] (plexus-form.js:806)
    at module.exports.React.createClass.render (plexus-form.js:180)
    at ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext (ReactCompositeComponent.js:789)
    ...

I'll investigate further...

bebraw commented 9 years ago

Looks like the source relies on props.schema['x-ordering']. It blows up because x-ordering property is missing from the example schema. I think you can patch around it by setting "x-ordering": [] at your schema.

Ideally this should be fixed on library level, though (just need to default to an empty array there).

odf commented 9 years ago

I am slightly confused. Commit e98ff08, the latest from master, works for me (Firefox 38.0 on Linux), whereas the latest release does not, but produces a different error.

bebraw commented 9 years ago

@odf Looks like the current stable version and master version aren't exactly the same. There are a few changes in master that probably explain that.

odf commented 9 years ago

@bebraw Yes, it's probably time for a new release. I'm just confused because I don't see fullOrdering/'x-ordering' related errors in either version.