GitXplorerGitXplorer
A

react-props-converter

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
358532c9f4e15c0b708421f63fc92b020c247247

Fix README

AAnber committed 8 years ago
Unverified
77e7458926d568d4d6a83c6f9107c1ba6bc03b5b

first commit

AAnber committed 8 years ago

README

The README file for this repository.

React props converter

// component.js
import React from 'react';
import createConverter from 'react-props-converter';
 
class Component extends React.Component {
  static propTypes = {
    value: React.PropTypes.number.isRequired,
  };
 
  render() {
    return (<div>{this.props.value}</div>);
  }
}
 
const converter = createConverter(props => ({ value: parseInt(props.value, 16) })); 
export default converter(Component); 
<Wrapped value="FF" /> // will be rendered as <div>255</div>