frintjs / frint

Modular JavaScript framework for building scalable and reactive applications
https://frint.js.org/
MIT License
756 stars 37 forks source link

TypeScript: Region component not found #410

Closed lianghan-ihealth closed 6 years ago

lianghan-ihealth commented 6 years ago

Region component not in the d.ts. I can not use it

lianghan-ihealth commented 6 years ago

thank you!please as soon as possible

fahad19 commented 6 years ago

@jackTheRipper: is it possible for you to take a look at it? =D

@markvincze: for the short-term gain, ca we suggest applying any TypeScript trick so that Region component can be imported without having to modify the monorepo's typings?

fahad19 commented 6 years ago

@lianghan-ihealth: until we have our next release with updated typings, may be you can try this locally:

declare module 'frint-react' {
  interface RegionProps {
    name: string;
    uniqueKey?: string;
    data?: any;
  }

  class Region extends React.Component<RegionProps, any> {  
  }
}

Following what's written in this blog post: https://templecoding.com/blog/2016/03/31/creating-typescript-typings-for-existing-react-components/

lianghan-ihealth commented 6 years ago

thank you all! frintjs is great.