Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component without give errors in typescript project #9

Closed
gino8080 opened this issue Jun 14, 2019 · 3 comments
Closed

Component without give errors in typescript project #9

gino8080 opened this issue Jun 14, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@gino8080
Copy link

gino8080 commented Jun 14, 2019

as subject, using without props says there are lots of missing required props

using simply as:

import React, {   SFC } from "react";
import  ReactGlobe  from "react-globe";
 
const Intro: SFC<any> = (props) => {

  return ( <ReactGlobe /> )		

}

export default Intro;

Generate a typescript error:

Type '{}' is missing the following properties from type 'Props': animations, cameraOptions, focusOptions, globeOptions, and 4 more

I forked https://github.com/gino8080/react-globe to convert all props to optional

@chrisrzhou
Copy link
Owner

Hi @gino8080, I will be pushing out an updated version soon that will fix up Typescript errors in the next few days! I'm new to Typescript but learned a lot when fixing up react-wordcloud package recently.

Stay tuned!

@chrisrzhou chrisrzhou added the bug Something isn't working label Jun 15, 2019
@gino8080
Copy link
Author

Thank you for your nice component!

i just made a PR #10 for a fast "hot fix" if you want to merge, otherwise just ignore it!

cheers

@chrisrzhou
Copy link
Owner

Hi @gino8080, thank you for your PR! I worked on a more permanent fix in 3.1.1 (codesandbox example) by correctly exposing the various Typescript types. You can install this with npm or yarn. The *Options props are now typed correctly with optional fields! Other types are exported as well. I got into Typescript recently, so I was slowly ramping up on getting this to work.

Thanks for your patience and let me know if you find any other bugs. Closing the task and PR for now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants