# react-native-on-layout

> A component for React Native that allows easy access to a view's rendered size

Latest version **2.0.2** (published 2017-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-on-layout
pnpm add react-native-on-layout
yarn add react-native-on-layout
bun add react-native-on-layout
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2017-07-11 |
| First published | 2017-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matthew Sessions |
| Maintainers | shichongrui |

## Links

- npm: https://www.npmjs.com/package/react-native-on-layout
- npm.io page: https://npm.io/package/react-native-on-layout

## Recent versions

- 2.0.2 (latest) — 2017-07-11
- 2.0.1 — 2017-07-11
- 2.0.0 — 2017-07-06
- 1.0.0 — 2017-06-27
- 0.1.1 — 2017-06-27
- 0.1.0 — 2017-06-27

## README

# react-native-on-layout

Having to get a components rendered dimensions is a pretty common pattern in React Native and this is a component that makes doing so easy.

    import OnLayout from 'react-native-on-layout'

    <OnLayout>
        {({ width, height}) => (
            <Text>{width} {height}</text>
        )}
    </OnLayout>

OnLayout renders a `View` component to do `onLayout` so you can pass any `View` prop to `OnLayout` and it will pass them as props to the rendered `View` component.

---
_Source: https://npm.io/package/react-native-on-layout · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
