![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react-native
|刘钊|
一切皆浮云
展开
-
ReactNative之组件回调函数的绑定
组件回调函数的绑定:import React from 'react';import { StyleSheet, Text, View, Dimensions, TextInput,} from 'react-native';export interface IProps {}export interface IState { inputedNum: st...原创 2020-01-06 23:50:14 · 590 阅读 · 0 评论 -
ReactNaitve之cocopod报错Invalid `RNFS.podspec` file: Malformed version number string v2.1.0-rc.1.
[!] Failed to load 'RNFS' podspec: [!] Invalid `RNFS.podspec` file: Malformed version number string v2.1.0-rc.1. # from /Users/liuzhao/Documents/Project/Develop/xsy-breeze-m-dayone/node_modules/r...原创 2019-09-09 10:12:18 · 684 阅读 · 0 评论 -
ReactNative之JSX 元素类型“Navigator”不具有任何构造签名或调用签名。ts(2604)
JSX 元素类型“Navigator”不具有任何构造签名或调用签名。ts(2604)这个主要是ts和js的写法的区别:js:传统的方式直接在构造函数中使用constructor(){ this.state = { num1:10 }}使用ts开发过程中需要先定义一个接口,规范数据类型,通过泛型传入到类中//定义一个接口规范state的类型...原创 2019-08-13 23:31:26 · 13164 阅读 · 1 评论 -
ReactNative之tsx文件中不存在属性
类型“Readonly<{}> ”上不存在属性“XX”。ts(2339)解决办法:export default class LZMain extends React.Component<any,any>将props和state类型定义成any就可以了;...原创 2019-08-13 22:43:06 · 1431 阅读 · 0 评论 -
reac之Error: Cannot find module 'webpack-cli'
Error: Cannot find module 'webpack-cli'解决办法:全局安装,终端输入:npm install webpack-cli -g如果有权限限制加上sudo:sudo npm install webpack-cli -g原创 2019-07-27 12:49:46 · 395 阅读 · 0 评论 -
react-nativ之Mac node已安装 但是报-bash: npm: command not found
到官网重新下载个node安装下就行了:下面是官网下载地址https://nodejs.org/en/原创 2019-07-27 12:45:57 · 2192 阅读 · 0 评论 -
ReacNative之Command `npm install --save --save-exact react-native` failed.
Error: EACCES: permission denied, mkdir '/Users/liuzhao/.npm/_npx/2938'TypeError: Cannot read property 'loaded' of undefined at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:9...原创 2019-07-31 22:26:57 · 531 阅读 · 0 评论 -
reactnative之vscode调试:Error: 执行命令 react-native run-ios --simulator --no-packager 时出错
[Error] Error: 执行命令 react-native run-ios --simulator --no-packager 时出错: 执行命令 react-native run-ios --simulator --no-packager 时出错 (error code 101)解决办法:找到文件:你的rn项目/node_modules/react-native/local-c...原创 2019-07-25 17:02:17 · 3977 阅读 · 0 评论 -
reactnative之npm ERR! code ELIFECYCLE
Error: listen EADDRINUSE: address already in use :::8081 at Server.setupListenHandle [as _listen2] (net.js:1226:14) at listenInCluster (net.js:1274:12) at Server.listen (net.js:1362:7)...原创 2019-07-29 19:17:44 · 555 阅读 · 0 评论 -
iOS react-native 之react-packager has encountered an internal error,please check your terminal error
1、react-native 之react-packager has encountered an internal error,please check your terminal error 错误提示很明显,就是程序开始跑了,让你打开终端,终端上会显示更新相关详情。解决办法:1、打开终端,重启下react-native,终端输入react-native start ...原创 2018-11-01 16:55:18 · 1986 阅读 · 0 评论 -
ios React-Native 之 找不到头文件
我的解决办法有点简单暴力:将package.json中的"react"直接改成16.2.0, react-native 改成了0.53.3,如下:"dependencies": { "react": "16.2.0", "react-native": "0.53.3", "react-navigation": "^1.4.0原创 2018-11-01 16:50:02 · 944 阅读 · 0 评论 -
pod react 之 [!] The name of the given podspec `yoga` doesn't match the expected one `Yoga
[!] The name of the given podspec `yoga` doesn't match the expected one `Yoga解决办法:1、我的Yoga的路径不对,看截图我的node_modules文件夹是在我的项目的根目录下,所以我修改路径:pod 'yoga', :path => './node_modules/react-native...原创 2018-11-01 12:36:36 · 2736 阅读 · 1 评论 -
ios 原生集成ReactNative错误总结2之TransformError
TransformError:/xx/xx/Desktop/RNDemo/RN/index.ios.js: /xx/xx/Desktop/package.json: Error while parsing JSON - Unexpected token \\ in JSON at position 1" 解决方法:cd到rn目录下,执行如下命令yarn/npm remove b...原创 2018-11-01 11:33:28 · 198 阅读 · 0 评论 -
ios 原生集成ReactNative错误总结1之Could not connect to development server.
iOS:React Native 之 Could not connect to development server.原创 2018-11-01 11:34:31 · 450 阅读 · 0 评论