jtassin/react-amount-field

View on GitHub
examples/src/Example1.jsx

Summary

Maintainability
C
7 hrs
Test Coverage
import React from 'react';
import ReactAmountField from '../../src/ReactAmountField';
 
export default class extends React.Component {
 
constructor() {
super();
this.state = {
val: '1337',
};
}
 
render() {
return (
Similar blocks of code found in 2 locations. Consider refactoring.
<div style={{ height: '50px' }}>
<div style={{ width: '50%', float: 'left' }}>
{this.state.val}
</div>
<div style={{ width: '50%', float: 'left' }}>
<ReactAmountField
onChange={(event) => { this.setState({ val: event.target.value }); }}
value={this.state.val}
><input type="text" /></ReactAmountField>
</div>
</div>
);
}
}