Skip to content

Commit

Permalink
Merge pull request #51 from MjukBiltvatt/master
Browse files Browse the repository at this point in the history
Migration to @react-native-community/art
  • Loading branch information
wonsikin authored Mar 23, 2020
2 parents 529d87f + c8daf26 commit cac030a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { PureComponent } from 'react';
import { View, StyleSheet, ART, Text } from 'react-native';
import { View, StyleSheet, Text } from 'react-native';
import PropTypes from 'prop-types';

import barcodes from 'jsbarcode/src/barcodes';

const { Surface, Shape } = ART;
import {Surface, Shape} from '@react-native-community/art';

export default class Barcode extends PureComponent {
static propTypes = {
Expand Down Expand Up @@ -48,9 +48,9 @@ export default class Barcode extends PureComponent {
};
}

componentWillUpdate(nextProps) {
if (nextProps.value !== this.props.value) {
this.update(nextProps);
componentDidUpdate(prevProps) {
if (prevProps.value !== this.props.value) {
this.update(this.props);
}
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"keywords": ["react-native", "barcode"],
"author": "WonSikin <[email protected]>",
"dependencies": {
"jsbarcode": "^3.8.0"
"jsbarcode": "^3.8.0",
"@react-native-community/art": "^1.2.0"
},
"peerDependencies": {
"prop-types": "^15.5.0"
Expand Down

0 comments on commit cac030a

Please sign in to comment.