/** * 获取 React-Native components 的 `width` 和 `height` * 代码来自:https://github.com/obipawan/react-native-measureme */ import React, { useState } from 'react'; import { View } from 'react-native'; import type { ViewProps } from 'react-native'; export type MeasureMeState = { width: number; height: number; initialRender: true; }; const measureMeHOC =
(ComposedComponent: React.ComponentType
): React.FC
=>
props => {
const [state, setState] = useState