Support for react 0.14
mwilc0x opened this issue ยท 18 comments
Hi,
Thanks for making this component! I'm not sure if you've tested this with react 0.14 yet, or if you're planning to support it in the future? Right now it will not install due to peerDependencies using npm 2.x w/ react 0.14-betax
It will install with npm 3, but I haven't extensively tested it yet.
I haven't test with the latest version yet. I definitely want to support the latest version of React. I wonder if it will still be broken once 0.14
is released? Is npm 3 currently out yet?
๐
๐
๐
๐
I am actually updating it to work with ReactJS 0.14 for transition. Which part is responsible that my input field is filled with my selection from the dropdown? Or more precisely how do you bind the clicked value to the input field?
Waiting for this to be merged: #21
@bdart i think that was managed by the "ref" on the renderInput but still is attached to the old behaviour of React 0.13
@arzola @gustavoguichard I did nearly the same changes as @ezequiel
focus: function() {
ReactDOM.findDOMNode(this.refs.input).focus()
},
the problem is that this change ends in that there is now error thrown but the focus event still does not happen. So the merge #21 just lags by the focus event for me actually
Anyone already fixed the "ref" issue inside the render method?
@arzola which issue do you mean explicit? I do not get any error in my version instead of that the focus event is not working
Hi @bdart i got
Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's
rendermethod, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
I think it's because on the main Typeahead "render" method there are a references like this (see below), if i comment the "ref: input" the warnings dissapear but it does not works
React.createElement(Input, { ref: "input",
Works but break the next components in the stack
Interestingly it does not cause any error for me. Whats about your package.json and the used versions? Maybe you have multiple instances of react running through your npm installation? But I do not think it have something to do with compatibility rather than a duplication.
Try to start from scratch and install this component than change dependencies to:
"react": "^0.14.*",
"react-dom": "^0.14.*",
"react-mixin": "^1.1.*",
"react-router": "^1.0.0-rc3",
Actually I do not know if all the three are needed but just to be sure. The versions are more important all over for an upgrade. After that go to your new created node_modules folder and change the three typeahead files the way the author did it here: #21
I actually reproduced it and it worked for me every time I rebuild it.
@bdart when i run a npm ls | grep react
i only got single React library loaded, as i said when i comment this:
<Input ref='input'
The "ref" input i avoid all of warnings and my another components works like a charm, but if i uncomment that line all is broken
I have a different problem. On React 0.14.3, I can't type in the input field. I looked into it a little bit. Apparently, the default value
property on the Input
component is always set to blank, and always overrides anything that I type in there. So the input field always remains blank.
I created a recent PR #29 which is a more complete update for React 14. It is not backwards compatible with v13 though.
I also have a scoped version published on npm @tappleby/react-typeahead-component which I am using until a PR w/ React 14 support gets merged.
๐