renderProps 的 Eslint 提示问题



  • renderProps 的使用,一直报以下错误,按照官方文档写法,应该是没问题的,虽然不影响编译,但报错很难受

    ESLint(taro/render-props) 错误:无法操作 this.props.renderCat
    -----
      24 |           我们可以把 prop 当成一个函数,动态地调整渲染内容。
      25 |         */}
    > 26 |         {this.props.renderCat(this.state)}
         |          ^^^^^^^^^^^^^^^^^^^^
      27 |       </View>
      28 |     );
      29 |   }
    

    环境:

    👽 Taro v1.3.22
    
    
      Taro CLI 1.3.22 environment info:
        System:
          OS: macOS 10.14.5
          Shell: 5.3 - /bin/zsh
        Binaries:
          Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
          npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
        npmPackages:
          @tarojs/components: 1.3.22 => 1.3.22
          @tarojs/plugin-babel: 1.3.22 => 1.3.22
          @tarojs/plugin-csso: 1.3.22 => 1.3.22
          @tarojs/plugin-sass: 1.3.22 => 1.3.22
          @tarojs/plugin-uglifyjs: 1.3.22 => 1.3.22
          @tarojs/router: 1.3.22 => 1.3.22
          @tarojs/taro: 1.3.22 => 1.3.22
          @tarojs/taro-alipay: 1.3.22 => 1.3.22
          @tarojs/taro-h5: 1.3.22 => 1.3.22
          @tarojs/taro-qq: 1.3.22 => 1.3.22
          @tarojs/taro-quickapp: 1.3.22 => 1.3.22
          @tarojs/taro-swan: 1.3.22 => 1.3.22
          @tarojs/taro-tt: 1.3.22 => 1.3.22
          @tarojs/taro-weapp: 1.3.22 => 1.3.22
          @tarojs/webpack-runner: 1.3.22 => 1.3.22
          eslint-config-taro: 1.3.22 => 1.3.22
          eslint-plugin-taro: 1.3.22 => 1.3.22
          nerv-devtools: ^1.5.0 => 1.5.5
          nervjs: ^1.5.0 => 1.5.5
          stylelint-config-taro-rn: 1.3.22 => 1.3.22
          stylelint-taro-rn: 1.3.22 => 1.3.22
        npmGlobalPackages:
          typescript: 3.5.3
    

登录后回复