fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 232 forks source link

Remove React as dependency #192

Closed troutowicz closed 8 years ago

troutowicz commented 8 years ago

React should only be a peer dependency. When included as a dependency, React will get loaded multiple times and break projects.

Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref.
fmoo commented 8 years ago

Did you want to fix the peerDependencies to specify 15.x instead of 0.14?

troutowicz commented 8 years ago

Sure, done @fmoo.

fmoo commented 8 years ago

@export-mike i'm not great with testing stuff, but it sounds like we need to break compatibility with react-14? (e.g., remove react:14 test stuff also, no?)

export-mike commented 8 years ago

@fmoo yeah I think you're right defaultValue I don't think is a thing in react 14. But our tests are not failing in 14, so it could be OK. We should spend some time testing/investigating?

fmoo commented 8 years ago

Oh, I'm thinking about typeahead, 1.x being broken on 15+, not 2.x being broken on 0.14+.

Since tests are passing, I'm just going to remove the ^15.0.1 dependency, and leave the peerDependency constraint on >= 0.14.

fmoo commented 8 years ago

I did 6ef5746c3252a7492421c1b163716cef04d403ab and published as 2.0.0-alpha.2