-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Closed
Description
As an exercise, I am currently transforming some class components into FunctionComponent, using the new hook style. But I faced a strange problem: class components can render undefined (and so, will not display anything), stateless function components can render undefined, but if we need the new FunctionComponent to render nothing, it can only return null, and not undefined (same for RefForwardingComponent).
I think this is a bug, and it will be annoying as my policy (and I know it is the same in many companies) is to avoid usage of null, and prefer undefined.
The correction is trivial, so if you confirm this is an issue, I can make a PR.
- I tried using the
@types/reactpackage and had problems. - I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
- Mention the authors (see
Definitions by:inindex.d.ts) so they can respond.- Authors: @eps1lon @Jessidhia @johnnyreilly @threepointone (sorry did not retrieved all authors' git name)
Metadata
Metadata
Assignees
Labels
No labels