chenglou / react-treeview

Easy, light, flexible tree view made with React.
1.09k stars 165 forks source link

Add React Native support #53

Closed jurassix closed 7 years ago

jurassix commented 7 years ago

This PR implements #21 by adding a new component src/react-native-treeview.js for use with React Native. This PR also contains a ReactNative demo app demo/ReactNativeTreeView that has working demo's of both Controlled and Uncontrolled examples from the React version.

Thanks for this great library and apologies for not opening an issue or commenting on open issue before submitting this PR, but that issue was over a year old. Thought it would help this move forward if I submitted a PR.

I modified the API to align it more with React Native naming, please review and let me know any changes you would like to see to move this PR forward.

Thanks!

propTypes: {
    arrowIcon: PropTypes.node,
    arrowStyle: PropTypes.object,
    childrenStyle: PropTypes.object,
    collapsed: PropTypes.bool,
    defaultCollapsed: PropTypes.bool,
    itemStyle: PropTypes.object,
    nodeLabel: PropTypes.node.isRequired,
    treeViewStyle: PropTypes.object,
  }
jurassix commented 7 years ago

Demo

demo-react-native-treeview

jurassix commented 7 years ago

I'm going to create a separate repo for native support. We can always merge back together in the future if the community pushes.

Thanks