react-json-editor icon indicating copy to clipboard operation
react-json-editor copied to clipboard

Fields are not rendering

Open hagitarowe opened this issue 8 years ago • 13 comments

Nothing renders passed the Title (screenshot from demo):

screen shot 2017-06-21 at 3 43 02 pm

hagitarowe avatar Jun 21 '17 22:06 hagitarowe

What browser are you running on?

ismaelga avatar Jun 21 '17 23:06 ismaelga

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

hagitarowe avatar Jun 21 '17 23:06 hagitarowe

You are running the demo on your machine right?

ismaelga avatar Jun 21 '17 23:06 ismaelga

Yes on OSX, steps to replicate:

  1. git clone https://github.com/ismaelga/react-json-editor/
  2. cd react-json-editor
  3. npm start
  • edit - I have tried reverting the package.json React dependency to 0.14.6 (pre-15) with the same results.

hagitarowe avatar Jun 21 '17 23:06 hagitarowe

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

hagitarowe avatar Jun 21 '17 23:06 hagitarowe

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

hagitarowe avatar Jun 22 '17 03:06 hagitarowe

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.

ashkanjj avatar Jul 13 '17 15:07 ashkanjj

@ashkanjj thanks for the ping.

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

ismaelga avatar Jul 13 '17 17:07 ismaelga

Closing issue, will look into fully implementing wrapped functions.

hagitarowe avatar Jul 13 '17 19:07 hagitarowe

@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.

hagitarowe avatar Jul 13 '17 21:07 hagitarowe

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?

chrissearle avatar Sep 26 '17 09:09 chrissearle

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?

blockspeiser avatar Nov 29 '17 01:11 blockspeiser

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

ismaelga avatar Feb 26 '18 17:02 ismaelga