Skip to content

obipawan/react-native-measureme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-measureme

NPM version

A HOC to make your React-Native components aware of their width and height

Installation

npm i --save react-native-measureme

Usage

import React from 'react';
import {View} from 'react-native';

const SizeAwareComponent = React.createClass({
    render(){
        //this component knows its render width and height through
        //this.props.width & this.props.height
        <View style={{width:this.props.width, height:this.props.height}} />
    }
});

module.exports = require('react-native-measureme')(SizeAwareComponent);

Development

PRs highly appreciated

License

MIT License

About

A HOC to make your React-Native components aware of their width and height

Resources

Stars

Watchers

Forks

Packages

No packages published