-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Assertion of _rootDOMNode
doesn't catch null
#157
Comments
What version of the library do u use? |
v5.0.6 |
Could u share repository with reproduced issue? It would certainly speed up the fix for this. |
@kevinhos any updates on this? |
I apologize. I've been struggling to find time to put together an example. |
Not sure if this is related, but works fine for me on 4.0.5, when I tried upgrading to 5.1 I got this error: When doing this (using variables from props): <Textarea
value={value}
onChange={onChange}
type={type}
name={field}
placeholder={placeholder}
ref={componentReference => this._input = componentReference}
/> |
@savovs could u reproduce on something like codesandbox.io ? |
@Andarist Hi, I have the same issue, when testing with jest (add snapshot) |
@dimon85 could u share a repository with reproduced issue and minimal setup? |
I am working in private repository, i need more time to create new repository. |
Sure thing, if I find some time I might do that myself, but lately I'm really busy and that's why I'm asking for a little bit of help here :) |
@Andarist Hi, take a look this repo https:/dimon85/textarea-test |
I've found the solution here. const tree = renderer.create(
<Textarea
name="description"
placeholder="Description"
/>,
{ createNodeMock: () => document.createElement('textarea') }
).toJSON(); Im not convinced at the moment that we should guard against this. Also - please use just |
@savovs @kevinhos Was your setup the same? jest + react-test-renderer? |
@Andarist I'm using jest and react-test-renderer. I got the same error trying to write a snapshot test. |
@mertkahyaoglu , my solution: |
I see the following issue testing components that rely on
react-textarea-autosize
:It seems like the following check should handle
null
: https:/andreypopp/react-textarea-autosize/blob/master/src/index.js#L134The text was updated successfully, but these errors were encountered: