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.

TypeScript complaining about RouterProvider props

See original GitHub issue

I’m getting and issue and typescript is complaining

JSX element class does not support attributes because it does not have a 'props' property.ts(2607)

You can see the setup here https://github.com/artellectual/artellectual/blob/master/app/index.tsx#L16

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
silentorbcommented, Mar 26, 2019

allowSyntheticDefaultImports prevents the error logs in strict mode.

import * as React from 'react' is the official method for importing React in TypeScript. It’s how the creators of the React type definitions import React.

1reaction
zacksiricommented, Mar 14, 2019

@titouancreach @troch understood. Will add allowSyntheticDefaultImports: true for now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Giving error when sending props in react typescript
I'm assuming you're not declaring AddToCart 's props properly (no pun intended). Your code should look something like this:
Read more >
React-redux Continuing #21417, unable to pass props from ...
React-redux Continuing #21417, unable to pass props from parent without TS2322 complaining about missing properties #25103.
Read more >
React-Typescript complaining about optional props missing ...
React-Typescript complaining about optional props missing (defined with prop-types). Hi, I'm converting a React JS codebase to TS.
Read more >
How to Use React Router in Typescript | Pluralsight
We see that a Route is a React.Component that receives props in the shape of RouteProps . It then renders the component provided...
Read more >
Passing Props to Child Components in React using TypeScript
I believe that if you are reading this article, you already have an idea of component hireraquia and... Tagged with react, javascript, node, ......
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