This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
3.0 has more restrictive JSX types than React allows for queries & mutations #3314
Closed

Description
Intended outcome:
The child renderers of mutation, query, and subscription components should accept valid react nodes (i.e. React.ReactNode
as it accepted in the 2.x branch)
Actual outcome:
Types have been redefined to JSX.Element | null
. This type is unnecessarily restrictive and prevents various patterns such as:
bool && <component>
, arrays of children, etc. Suggest JSX.Element | null
-> React.ReactNode
as the child return types for all 3 ComponentOptions
How to reproduce the issue:
Version
System:
OS: macOS 10.14.6
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.17.3 - ~/airlab/repos/nova/node_modules/.bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: 76.0.3809.87
Safari: 12.1.2
npmPackages:
apollo: ^2.16.3 => 2.16.3
apollo-client: ^2.5.1 => 2.6.3
react-apollo: ^3.0.0-beta.4 => 3.0.0-beta.4