elierotenberg / elierotenberg/react-traverse

Wrapped react-widgets' NumberPicker does not work

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
69
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Hi,
I find your react-traverse library really cool and I was able to use it successfully. Unfortunately I now stumbled about a component which does not proper work when traversed even if no modification is applied.
Here is the case (see attachment):
- Two NumberPicker components (from ['react-widgets' lib](https://github.com/jquense/react-widgets))
are on the screen, first one w/o wrapping, second is wrapped.
- If you click into the second input field following error appears in the console:

Uncaught TypeError: Cannot read property 'focus' of null

- Looking into NumberPicker it seems that following code does not work:

```
focus() {
compat.findDOMNode(this.refs.input).focus()
},
```
- Investigating this I expected that 'refs' might get confused by the use of react-traverse and thus added a test using refs: With component 'SimilarNumberPicker' I tried to readjust this case: But here refs work after wrapping!

Do you have an idea why NumberPicker does not work after the wrapping?
Thanks for your thoughts!

[ReactWidgetsWithTraverse.zip](https://github.com/elierotenberg/react-traverse/files/289006/ReactWidgetsWithTraverse.zip)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.