idibidiart / react-native-responsive-grid

Bringing the Web's Responsive Design to React Native
Other
379 stars 42 forks source link

Add Typescript definition file. #10

Open janstrohbeck opened 7 years ago

janstrohbeck commented 7 years ago

This adds a definition file for easier integration with Typescript projects.

idibidiart commented 6 years ago

Thanks for this and sorry for the delay. I haven't worked on this for some months. I've just made a fix to one of the PropTypes definitions, so I'll have to fix it in your PR and include it.

I've made major enhancements including introduction of a stateful and optional Grid root for better abstraction around layout state and just made this demo here: https://www.youtube.com/watch?v=QyIRoKinyLU (source code linked in Readme)

Given I've not used TypeScript, is there anything I have to do (in package.json or otherwise) besides including the definition file in the root folder?

janstrohbeck commented 6 years ago

Yes, you need to add a "types" entry in package.json (like in my commit), as well as add @types/react and @types/react-native to dependencies (which I forgot in my original commit). Should I rebase my PR to the latest master and make those additions?

idibidiart commented 6 years ago

Yes, please. That would be awesome! Thank you. Will add Contributors.md later today..

janstrohbeck commented 6 years ago

Ok, I updated the definition file to the one that I use in my project. I added the Grid component and the necessary dependencies. I also added some props that I think are missing in the PropTypes, like size and sizePoints at the Row component. Is that correct? They are mentioned in the Readme file, but not validated via PropTypes... If they should be in the PropTypes, I can also add them in this PR.

idibidiart commented 6 years ago

@janstrohbeck

Row is actually missing more of those

{
size,
smSize,
mdSize,
lgSize,
xlSize,
sizePoints,
smSizePoints,
mdSizePoints,        
lgSizePoints,
xlSizePoints,
}

All of these are valid and need to have corresponding PropTypes. Thank you for noticing that.

So, yes, would be great to add this list of props to the PR.

One note on the original PR, there was an issue #11 in the PropTypes for Row component, and I'm not sure that got incorporated in your latest.