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
and then use that component with children (implicitly sets this.props.children):
// index.tsximportReactfrom'react';importReactDOMfrom'react-dom';import'./index.css';importAppfrom'./App';importreportWebVitalsfrom'./reportWebVitals';importNullfrom'./Null';ReactDOM.render(<React.StrictMode><Null><App/></Null></React.StrictMode>,document.getElementById('root'));// If you want to start measuring performance in your app, pass a function// to log results (for example: reportWebVitals(console.log))// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitalsreportWebVitals();
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
Describe the bug
If for some reason, you type props as null and return null in
render
and then use that component with children (implicitly sets this.props.children):
the resulting error crashes npm start
Did you try recovering your dependencies?
(Write your answer here.)
my-ts-app-2:
npm --version
gets8.1.1
solver:
yarn --version
gets3.0.2
Which terms did you search for in User Guide?
(Write your answer here if relevant.)
Environment
(paste the output of the command here.)
Steps to reproduce
(Write your steps here:)
npx create-react-app@next --scripts-version=@next --template=typescript@next my-ts-app
cd my-ts-app
Null.tsx
as shown above and editindex.tsx
as shown aboveExpected behavior
(Write what you thought would happen.)
Errors but doesn't crash typescript itself
Actual behavior
I don't think typescript is supposed to crash
(Write what happened. Please add screenshots!)
Before typing props as null
![image](https://user-images.githubusercontent.com/58114641/138604107-9c9e1f41-1141-45b5-ab2d-c29f5aed4151.png)
After
![image](https://user-images.githubusercontent.com/58114641/138604136-bbe38751-d8b3-40cc-861c-1ceca3d68842.png)
Reproducible demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
icecream17/my-ts-app-2@9aa67c5
The text was updated successfully, but these errors were encountered: