Code Monkey home page Code Monkey logo

taro-sign's Issues

taro-ui

由于小程序的限制,无法遍历 this.props.children, AtTabsPane 需要用户自行传入 current 和 index 参数。

可以用 React.Children.map 来遍历子节点,而不用担心 this.props.children 的数据类型是 undefined 还是 object。
renderProps组件

notice

  • sourcemap不能用就很xxxxx**

  • 不能解构传值,需要key value传给子组件

  • 不能在render之外写jsx

  • this.props传来的函数必须on或者dispatch开头

  • 父组件传来的props,必须定义在static defaultProps里,要不然获取不到

  • componentDidMount,在微信/百度/字节跳动/支付宝小程序中这一生命周期方法对应 app 的 onLaunch

  • componentDidShow在微信/百度/字节跳动/支付宝小程序中这一生命周期方法对应 onShow

  • componentDidHide在微信/百度/字节跳动/支付宝小程序中这一生命周期方法对应 onHide

  • JS 代码里必须书写单引号,特别是 JSX 中,如果出现双引号,可能会导致编译错误

  • 环境变量 process.env 的使用,不要以解构的方式来获取通过 env 配置的 process.env 环境变量,请直接以完整书写的方式 process.env.NODE_ENV 来进行使用

  • 使用 this.$componentType 来判断当前 Taro.Component **是页面还是组件,可能取值分别为 PAGE 和 COMPONENT

  • 不支持无状态组件

  • 不能在包含 JSX 元素的 map 循环中使用 if 表达式

  • 不能使用 Array#map 之外的方法操作 JSX 数组

  • 父组件要往子组件传递函数,属性名必须以 on 开头

以上是使用过程中遇到的问题,具体注意事项请查阅https://nervjs.github.io/taro/docs/best-practice.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.