Skip to content
Advertisement

Conversion React Typescript component into Javascript gives errors

I am playing with React Fiber and React Drei but i do not want to use Typescript like in the examples i have found in their git

I have converted the following example Stars.tsx with typescriptlang tool

This is the output

JavaScript

Then i have paste this Stars component in my codesandbox

The component is now commented at the row 28 of index.js because i get the following error

JavaScript

I do not understand exactly where the problems is with this error.

What is wrong with stars.js component that i have converted from typescript to javascript? How can i fix it?

Advertisement

Answer

Import the named Stars, like:

JavaScript

Working example: https://codesandbox.io/s/elegant-lumiere-1wf3uo

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement