百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-navigation-heavy-screen

> 编程语言
开源

QQ 优化重屏幕,以防止在回放导航过渡时出现滞后.

377 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

QQ 优化重屏幕,以防止在回放导航过渡时出现滞后.

⚡️ Speed up heavy React Native screens

Optimize heavy screens in React Native to prevent lags with React Navigation's stack.

This isn't actually specific to React Navigation, but I find myself using it there often.

Especially useful for screens that set up listeners, make network requests, etc.

Usage

New component-based API! Use this if you only want to optimize certain content on your screen.

javascript
import React from 'react'
import { OptimizedHeavyScreen } from 'react-navigation-heavy-screen'

const Screen = () => (
  <>
    
    
      
    
  
)

You can also use the normal export usage. Use this if you want to optimize your whole screen.

javascript
import { optimizeHeavyScreen } from 'react-navigation-heavy-screen'

const Screen = () => ...

export default optimizeHeavyScreen(Screen, OptionalPlaceHolderScreen)

Or you can require your heavy screen inline:

javascript
import { optimizeHeavyScreen } from 'react-navigation-heavy-screen'

export default optimizeHeavyScreen(
  require('path/to/HeavyScreen'),
  OptionalPlaceHolderScreen
)

Thanks to @Sebastien Lorber for this recommendation ^

Installation

bash
yarn add react-navigation-heavy-screen

Install peer dependencies:

bash
expo install react-native-reanimated

What does it do?

Delay rendering a component until interactions are complete, using InteractionManager. Then it fades in your screen.


``

Props

  • placeholder (optional) Non-heavy React component that renders in the meantime.
  • Extends Animated.View props docs. So you can pass any props you need to customize the animation. eg: { entering: { FadeIn } }
javascript
import React from 'react'
import { OptimizedHeavyScreen } from 'react-navigation-heavy-screen'

const Screen () => (
  
    
  
)

export default Screen

optimizeHeavyScreen(Screen, Placeholder, options)

javascript
import { optimizeHeavyScreen } from 'react-navigation-heavy-screen'

export default optimizeHeavyScreen(Screen, OptionalPlaceHolderScreen, {
  // default values
  disableHoistStatics: false,
})

Arguments

  • Screen required Any React component whose render should be delayed until interactions are complete.
  • Placeholder (optional) Non-heavy React component that renders in the meantime.
  • options (optional) Dictionary with the following options:
    • disableHoistStatics: (optional) If true, the Screen's statics (like navigationOptions, etc.) will not be passed on. Default: false.
    • Extends Animated.View props docs. So you can pass any props you need to customize the animation. eg: { entering: { FadeIn } }

License

MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言