React Native 相关学习


layout: post title: “React Native Learning” description: "" category: devtech/react tags: [react native] top: true


React 相关

在组件间共享函数的方法:

参考此文:通过示例理解 React 的 render props 技巧

  • render props, 更适合只读的函数,例如跟踪滚动条、鼠标动作等;
  • HOC(High order component), 更适合较复杂的方法,如 local storage 等;

相关文档资料

Style 的笔记

  • alignItems ReactPropTypes.oneOf([ ‘flex-start’, ‘flex-end’, ‘center’, ‘stretch’ ])
    • stretch 向两边伸展
  • alignSelf ReactPropTypes.oneOf([ ‘auto’, ‘flex-start’, ‘flex-end’, ‘center’, ‘stretch’ ])
  • flexDirection ReactPropTypes.oneOf([ ‘row’, ‘row-reverse’, ‘column’, ‘column-reverse’ ])
  • flexWrap ReactPropTypes.oneOf([ ‘wrap’, ‘nowrap’ ])
  • justifyContent ReactPropTypes.oneOf([ ‘flex-start’, ‘flex-end’, ‘center’, ‘space-between’, ‘space-around’ ])