From 2a0428c979c1028aefa7b0e6aac0b9e47f1ab917 Mon Sep 17 00:00:00 2001 From: Dan Homola Date: Tue, 20 Jun 2017 20:51:36 +0200 Subject: [PATCH 1/2] refactor: remove 'size' prop The 'size' prop was removed in favour of 'className', 'style' and 'width' props BREAKING CHANGE: The 'size' prop was removed and will no longer work #45 --- README.md | 1 - demo/Demo.jsx | 16 +++++----------- index.d.ts | 4 ---- tests/typescript/index.tsx | 2 +- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3eb017d6..c2765c09 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,6 @@ The props available are (shown with default values): ```js { value: '', // The value to encode in the code - size: 256, // Size of the code in pixels. This is obsolete and will be removed in the next major version! level: 'L', // QR Error correction level bgColor: '#FFFFFF', // Color of the bright squares fgColor: '#000000', // Color of the dark squares diff --git a/demo/Demo.jsx b/demo/Demo.jsx index c78fc118..f95012e3 100644 --- a/demo/Demo.jsx +++ b/demo/Demo.jsx @@ -6,7 +6,6 @@ class Demo extends React.Component { super(props, context); this.state = { value: 'Try changing the values and see the code update in real-time!', - size: 256, level: 'L', bgColor: '#FFFFFF', fgColor: '#000000', @@ -14,13 +13,12 @@ class Demo extends React.Component { } updateValue = e => this.setState({ ...this.state, value: e.target.value }); - updateSize = e => this.setState({ ...this.state, size: +(e.target.value) }); updateLevel = e => this.setState({ ...this.state, level: e.target.value }); updateBgColor = e => this.setState({ ...this.state, bgColor: e.target.value }); updateFgColor = e => this.setState({ ...this.state, fgColor: e.target.value }); render() { - const { state, updateSize, updateValue, updateLevel, updateBgColor, updateFgColor } = this; + const { state, updateValue, updateLevel, updateBgColor, updateFgColor } = this; return (
@@ -29,7 +27,7 @@ class Demo extends React.Component {