Unify name of ReactNode type in document
See original GitHub issueCurrently we have many names for ReactNode type props in document, such as:
React.ReactNode
React.Element
String/element
React.Element or String
String or Element
string or React.ReactNode
- …
According to the React’s declaration file:
type ReactText = string | number;
type ReactChild = ReactElement<any> | ReactText;
// Should be Array<ReactNode> but type aliases cannot be recursive
type ReactFragment = {} | Array<ReactChild | any[] | boolean>;
type ReactNode = ReactChild | ReactFragment | boolean | null | undefined;
I propose to unify the name of this kind type to string|ReactNode
.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Type '{}' is not assignable to type 'ReactNode'. #35986 - GitHub
Its instance type 'ReactQuill' is not a valid JSX element. The types returned by 'render()' are incompatible between these types. Type 'React.
Read more >Type '{}' is not assignable to type 'ReactNode' - Stack Overflow
We started experiencing this issue on our build server without making significant changes last week and have not managed to find a fix...
Read more >Composing React Components with TypeScript - Pluralsight
In this guide, you will learn how to compose React.js components using the compile-to-JavaScript language, TypeScript. Using TypeScript with ...
Read more >The React.ReactNode type is a black hole - Changelog
The React.ReactNode type is a black hole ; eliminate an entire class of runtime bugs , where a function gets passed an object...
Read more >rehype-react - unified
This plugin adds a compiler for rehype, which means that it turns the final HTML (hast) syntax tree into something else (in this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Create a wiki page https://github.com/ant-design/ant-design/wiki/Document-types-conventions
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.