You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.
Since tcomb-react is using a very small (and stable?) subset of the React API (only ReactElement and ReactNode), it might be preferable to not have a hard dependency on React and a specific version.
Instead, create the t.React* types dynamically by accepting a React object.
Hi @zaim,
Actually tcomb-react should be compatible with react@0.14.0-rc1 as the only API used is React.isValidElement (ReactElement and ReactNode are tcomb types).
Hmmm... I'm still getting 2 copies of React in node_modules, that is:
The "main" node_modules/react (0.14.0-rc1)
The one tcomb-react uses, node_modules/tcomb-react/node_modules/react (0.13.3)
Browserifying would include both copies, I think.
I think it's because 0.14.0-rc1 (anything with -prerelease) does not satisfy >=0.13.0 which is what's in your package.json.
So basically, my suggestion would make tcomb-react compatible with any and every future React releases, including pre-releases (as long as React.isValidElement is not deprecated 😉)
my suggestion would make tcomb-react compatible with any and every future React releases, including pre-releases (as long as React.isValidElement is not deprecated 😉)
Indeed, I thought that >=0.13.0 would be enough but it doesn't work with release candidates.
Related npm/npm#8854
Hi.
Since tcomb-react is using a very small (and stable?) subset of the React API (only
ReactElement
andReactNode
), it might be preferable to not have a hard dependency on React and a specific version.Instead, create the
t.React*
types dynamically by accepting aReact
object.Usage would be something like:
This might be a breaking change since
t.React*
types won't be available at first import.Another approach is to wrap your
require('react')
with atry catch
.Or is this too complicated? It's just that I wanted to try this with React 0.14.0-rc1 but cant... :)
The text was updated successfully, but these errors were encountered: