Create React Native project by Expohttps://docs.expo.dev/guides/typescript/#starting-from-scratch-using-a-typescript-templateUse NativeWindhttps://www.nativewind.dev/quick-starts/expohttps://www.na...
新建React Native空白项目安装依赖:yarn add @react-navigation/bottom-tabs react-native-safe-area-context createBottomTabNavigator最简洁的tabbar示例,App.tsx里放置代码:import * as React from 'react';
import { Text, View } ...
onChange={(e)=>{
if (! /^\d?(\d+[\.]?\d*)?$/.test(e.target.value) ) return
setInputVal(e.target.value)
}}^\d?表示0个或1个数字开头\d+表示1个或1个以上数字[.]?表示0个或者1个小数点\d*表示0个或0个以上的数字(\d+[.]?\d*)?表示括号里可以重复0遍或0...
新建react native项目npx create-expo-app -t expo-template-blank-typescript根据教程配置https://github.com/expo/config-plugins/tree/main/packages/ffmpeg-kit-react-native安装依赖yarn add ffmpeg-kit-react-native @con...
import BigNumber from "bignumber.js"
export function bigNumberFloor(num: string|number|BigNumber, decimals: number): string {
return new BigNumber(num).times(10**decimals).idiv(1).div(1...
React Native Webview组件没有自带的方式可以监听网页内部资源的加载(jpg, png, js, css, mp3等),曲线实现方式:用js注入定时器到网页,网页里获取节点的src属性并postMessage给native,以img节点为例:import { WebView } from 'react-native-webview'
let srcs:string[] = [...
很多时候,input只关心最后状态,不需要用useState有时候并不需要用useEffect去改变值useMemo防止object在重新渲染时再内部值不变时被更换内存地址,变成新“值”适时终止过时的api请求
https://www.npmjs.com/package/bignumber.jsimport BigNumber from "bignumber.js"
console.log( new BigNumber('123456789.7654321').toFormat(2) )输出:123,456,789.77
Add custom.d.ts to ./scrdeclare module '*.svg' {
import React = require('react')
export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>
const src: string
export de...
前端在调用别人 api 时经常遇到跨域或者 https 无法调用 http 的问题,通过反代即可解决deno.com 提供免费的 NodeJS 环境,在其官网后台新建应用,在 playground 粘贴代码:import { serve } from "https://deno.land/
[email protected]/http/server.ts"
serve(async (r...
- 1
- 2
- 3
- 4
- ...
- 7
- 后一页 »