随笔分类 -  React-Native

摘要:实现效果 import Share from 'react-native-share' import ViewShot from 'react-native-view-shot' const shotRef = useRef<ViewShot>(null) const getTime = () => 阅读全文
posted @ 2023-07-19 10:25 龙卷风吹毁停车场 阅读(83) 评论(0) 推荐(0)
摘要:调用手机系统原生分享如下图 使用: react-native-sharereact-native-share官网 阅读全文
posted @ 2023-06-20 14:17 龙卷风吹毁停车场 阅读(56) 评论(0) 推荐(0)
摘要:在 componentDidMount 函数中添加 this.props.navigation.addListener('focus', () => { alert(2) }); 阅读全文
posted @ 2022-12-12 15:06 龙卷风吹毁停车场 阅读(330) 评论(0) 推荐(0)
摘要:navigation.navigate('home', { activeFilterTab: 'posted' }) //传递的对象{ activeFilterTab: 'posted' } 接收方: route.paeams.activeFilterTab 就行 阅读全文
posted @ 2022-12-09 18:06 龙卷风吹毁停车场 阅读(97) 评论(0) 推荐(0)
摘要:import { useFocusEffect } from '@react-navigation/native'; useFocusEffect(React.useCallback(() => { console.log('当前页面被激活啦!'); }, [])); 阅读全文
posted @ 2022-10-10 10:06 龙卷风吹毁停车场 阅读(78) 评论(0) 推荐(0)
摘要:要修改里面的内容 阅读全文
posted @ 2022-10-08 14:15 龙卷风吹毁停车场 阅读(30) 评论(0) 推荐(0)
摘要:github 地址 : https://github.com/Genymobile/scrcpy/releases 根据自己电脑操作系统位数下载 阅读全文
posted @ 2022-10-05 08:38 龙卷风吹毁停车场 阅读(23) 评论(0) 推荐(0)
摘要:react-native 报错 :Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidU 阅读全文
posted @ 2022-09-30 11:12 龙卷风吹毁停车场 阅读(2327) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-25 15:09 龙卷风吹毁停车场 阅读(38) 评论(0) 推荐(0)
摘要:const isYesterday=(theDate='2022-1-1 10:12:00')=>{ theDate = new Date(theDate) var date = (new Date()); //当前时间 var today = new Date(date.getFullYear() 阅读全文
posted @ 2022-09-25 13:50 龙卷风吹毁停车场 阅读(43) 评论(0) 推荐(0)
摘要:Error: Too many re-renders. React limits the number of renders to prevent an infinite loop. 错误:重新渲染过多。 React 限制了渲染的数量以防止无限循环。 不能在条件语句里面执行hooks 需要写到use 阅读全文
posted @ 2022-09-23 15:05 龙卷风吹毁停车场 阅读(805) 评论(0) 推荐(0)
摘要:废话不多说,直接上硬货:效果图 安装 react-native-anchor-point 用于处理旋转中心点位置 yarn add react-native-anchor-point github仓库地址: https://github.com/sueLan/react-native-anchor- 阅读全文
posted @ 2022-09-23 09:47 龙卷风吹毁停车场 阅读(788) 评论(0) 推荐(0)
摘要:xxxRef.current.你的方法() 阅读全文
posted @ 2022-09-19 14:06 龙卷风吹毁停车场 阅读(24) 评论(0) 推荐(0)
摘要:import React, {Component} from 'react'; import {Text, View, TouchableOpacity} from 'react-native'; // 父 let child onRefbbb = (ref) => { child = ref } 阅读全文
posted @ 2022-09-09 10:18 龙卷风吹毁停车场 阅读(139) 评论(0) 推荐(0)
摘要:导航使用的是 @react-navigation/native componentDidMount(){ let { navigation } = this.props navigation.addListener('beforeRemove', (e) => { e.preventDefault( 阅读全文
posted @ 2022-09-08 18:12 龙卷风吹毁停车场 阅读(466) 评论(0) 推荐(0)
摘要:一个很棒的跨平台 React Native 日期选择器和日历组件,适用于 iOS 和 Android。最下面附带截图 https://github.com/lchenfox/react-native-common-date-picker 安装: yarn add react-native-commo 阅读全文
posted @ 2022-09-06 18:31 龙卷风吹毁停车场 阅读(907) 评论(0) 推荐(0)
摘要:import React, {Component} from 'react'; import {Text, View, TouchableOpacity} from 'react-native'; export default class Parent extends Component { onR 阅读全文
posted @ 2022-09-05 17:58 龙卷风吹毁停车场 阅读(118) 评论(0) 推荐(0)
摘要:父组件 class 类组件, 关键代码我用红色部部分标记 import React from "react"; import { View,Text} from "react-native"; import HomeModalChilder from "../../components/homeMo 阅读全文
posted @ 2022-09-02 18:22 龙卷风吹毁停车场 阅读(220) 评论(0) 推荐(0)
摘要:github地址: https://github.com/SrBrahma/react-native-shadow-2安装: yarn add react-native-svg react-native-shadow-2 使用: import { Shadow } from 'react-nativ 阅读全文
posted @ 2022-09-02 14:44 龙卷风吹毁停车场 阅读(246) 评论(0) 推荐(0)
摘要:安装依赖 mobx 核心库 mobx-react 方便在react中使用mobx技术的库 @babel/plugin-proposal-decorators 让rn项目支持es7的装饰器语法 安装: yarn add mobx mobx-react @babel/plugin-proposal-de 阅读全文
posted @ 2022-09-02 14:37 龙卷风吹毁停车场 阅读(128) 评论(0) 推荐(0)