ismaelga / react-json-editor

A dynamic form component for react using JSON-Schema.
https://ismaelga.github.io/react-json-editor
MIT License
225 stars 42 forks source link

Fields are not rendering #34

Open hagitarowe opened 7 years ago

hagitarowe commented 7 years ago

Nothing renders passed the Title (screenshot from demo):

screen shot 2017-06-21 at 3 43 02 pm
ismaelga commented 7 years ago

What browser are you running on?

hagitarowe commented 7 years ago

Firefox 54.0, Chrome 59.0.3071.104, and Safari 10.1.1 (12603.2.4)

Here is the console from Firefox:

screen shot 2017-06-21 at 4 05 34 pm

*edit - removed second half of post due to non-related issue

ismaelga commented 7 years ago

You are running the demo on your machine right?

hagitarowe commented 7 years ago

Yes on OSX, steps to replicate: 1) git clone https://github.com/ismaelga/react-json-editor/ 2) cd react-json-editor 3) npm start

hagitarowe commented 7 years ago

@ismaelga I found the issue, I will make a fork & pull request when I get home.

hagitarowe commented 7 years ago

@ismaelga PR here: https://github.com/ismaelga/react-json-editor/pull/35

ashkanjj commented 7 years ago

I'm having a similar issue. Is still repo still maintained?

The PR #35 has been raised 22 days ago and no one has merged it.

ismaelga commented 7 years ago

@ashkanjj thanks for the ping.

@hagitarowe I should be able to review the PR later today. Sorry for the delay

hagitarowe commented 7 years ago

Closing issue, will look into fully implementing wrapped functions.

hagitarowe commented 7 years ago

@ismaelga Please correct me if I am wrong, but after some reading, there doesn't seem to be any way of comparing props whenever types methods are called as the new values are set prior to the function call so I am unsure as to what you meant by:

And I'm pretty sure those are wrapped in functions so it's possible to not run them if not needed (if the props for that component is the same).

In order to facilitate this, wouldn't we require a method to store and retrieve previous props in order to compare at fields.make in the form render function? Also, types.alternative does not have a wrapper like types.object && types.array, although the same logic should apply if the intention was to compare prop values to check whether or not to call the function.

Additionally, in the same commit listed above, shouldComponentUpdate was added to the wrapper components, which assumably was introduced to solve the quoted issue.

chrissearle commented 7 years ago

Is there any progress on this? I've manged to grab the closed PR just to get a running demo (for what I'm working on using Demo as a test harness is what I need in the first part) - just wondered if there had been any work done since July?

blockspeiser commented 6 years ago

I'm also interested in updates ons this, and getting the same behavior.

The README starts with "This is a fork of plexus-form with the intent to keep it maintained" -- but the whole package has been broken for months without update?

ismaelga commented 6 years ago

Sorry guys. I haven't giving the proper ❤️to this. For anyone that comes here I just want to say I will try to work a bit on it this next weeks.

Also, you might want to consider using/moving to https://github.com/mozilla-services/react-jsonschema-form as it's better maintained and IMO better designed