Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react error on rendering with v1.0.5 #1042

Closed
pieper opened this issue Oct 2, 2018 · 8 comments
Closed

react error on rendering with v1.0.5 #1042

pieper opened this issue Oct 2, 2018 · 8 comments

Comments

@pieper
Copy link

pieper commented Oct 2, 2018

Prerequisites

  • [ x] I have read the documentation;
  • [ x] In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.

Description

Error using form

Related to #991

Steps to Reproduce

Load this page and look in the log

http://pieper.github.io/sites/schemaform/bug-1.0.5.html

Expected behavior

Should be a simple example form

Actual behavior

Error messages pasted below

Version

1.0.5 (1.0.3 worked, 1.0.4 had different error)

Tested on Chrome.

Error messages:

Uncaught TypeError: Cannot read property 'parentElement' of null
    at Object.customOnChange [as onChange] (schemaformDemo.js:62)
    at new t (Form.js:33)
    at constructClassInstance (react-dom.development.js:11892)
    at updateClassComponent (react-dom.development.js:13614)
    at beginWork (react-dom.development.js:14213)
    at performUnitOfWork (react-dom.development.js:16539)
    at workLoop (react-dom.development.js:16577)
    at HTMLUnknownElement.callCallback (react-dom.development.js:139)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:189)
    at invokeGuardedCallback (react-dom.development.js:242)
react-dom.development.js:14673 The above error occurred in the <t> component:
    in t

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ react-dom.development.js:14673
react-dom.development.js:17479 Uncaught TypeError: Cannot read property 'parentElement' of null
    at Object.customOnChange [as onChange] (schemaformDemo.js:62)
    at new t (Form.js:33)
    at constructClassInstance (react-dom.development.js:11892)
    at updateClassComponent (react-dom.development.js:13614)
    at beginWork (react-dom.development.js:14213)
    at performUnitOfWork (react-dom.development.js:16539)
    at workLoop (react-dom.development.js:16577)
    at renderRoot (react-dom.development.js:16656)
    at performWorkOnRoot (react-dom.development.js:17510)
    at performWork (react-dom.development.js:17418)
@glasserc
Copy link
Contributor

glasserc commented Oct 2, 2018

From comments on #991, it seems like this is due to #1034. @llamamoray, any thoughts?

@llamamoray
Copy link
Collaborator

This might be a bit off topic, but do you achieve hiding a field by accessing the DOM node in production code? This doesn't feel particularly robust to me. If I wanted to implement this kind of logic I'd be far more comfortable writing my own widget or using the oneOf functionality.

@pkosiec
Copy link

pkosiec commented Oct 23, 2018

Hi, is anybody working on the issue?

@derberg
Copy link

derberg commented Nov 8, 2018

@glasserc & @llamamoray do you know what are the plans for next release? is 1.0.6 blocked by this issue, if yes, how can we help?

@llamamoray
Copy link
Collaborator

See my comment above, I don't see how the example given is a sensible implementation of what was trying to be achieved.

@derberg
Copy link

derberg commented Nov 9, 2018

@llamamoray if there is no response from the reporter, you think it is not a release blocker, maybe the decision should be to publick 1.0.6 🙈

@glasserc
Copy link
Contributor

glasserc commented Nov 9, 2018

Yeah, I agree with @llamamoray -- modifying the DOM directly is super brittle and not very React-y, so I don't think we should support this, so I don't think we need to specify whether the onChange function gets run before or after the DOM instantiation. I'll try to cut a 1.0.6 release.

@glasserc glasserc closed this as completed Nov 9, 2018
@pieper
Copy link
Author

pieper commented Nov 9, 2018

Thanks for looking at this 👍 Yes, if the example doesn't demonstrate a valid use case then it's fine for this issue to be closed.

At the time I was testing I didn't see another way to implement the UI I was looking for, and it did work in the previous release. When I have time to look at the project again maybe I'll find new functionality or I can ask for pointers about preferred implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants