Closed janslow closed 7 years ago
Looks like the test failures are unrelated to this change, will take a look into that when I get a moment.
Sorry, I hadn't noticed the comment about peerDependencies
, I've removed that (and the @types/react
for consistency). The @types/react
is the typescript definitions of React, so that the types of a React element and component can be used.
I've also restricted the context and props types, per your suggestions.
I believe I've also corrected the Selector/Matcher types. Selector can either be a string or a React component type and Matcher can either be an object (i.e., a subset of component props) or a predicate which takes a react node.
Also, out of interest, what's your reason against using peer dependencies for React? Surely "react": ">= 0.14.0"
provides enough flexibility for users, as it adds allows all React versions above/including the supported 0.14
.
@janslow ">= 0.14" makes a promise that isn't really true - it's claiming to work with any new version, but I have no idea if we'll work with the next version.
For that reason I just leave it out.
Released in v1.0.0-alpha2
That's great, thanks.
Adds type definitions to assist TypeScript developers.