question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unify name of ReactNode type in document

See original GitHub issue

Currently 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

0reactions
lock[bot]commented, May 2, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found