diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..a9e3ddf --- /dev/null +++ b/.babelrc @@ -0,0 +1,9 @@ +{ + "plugins": [ + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-object-rest-spread" + ], + "presets": [ + "module:metro-react-native-babel-preset" + ] +} diff --git a/package.json b/package.json index 6fd3942..8dc9bf1 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,16 @@ { - "name": "react-native-deprecated-custom-components", + "name": "@click-therapeutics-org/react-native-deprecated-custom-components", "version": "0.1.1", "description": "Deprecated custom components that originally shipped with React Native", "repository": { "type": "git", "url": "git@github.com:facebookarchive/react-native-custom-components.git" }, - "main": "src/CustomComponents.js", + "scripts": { + "build": "npx babel ./src --out-dir ./dist --copy-files", + "prepublishOnly": "npm run build" + }, + "main": "dist/CustomComponents.js", "dependencies": { "fbjs": "~0.8.9", "immutable": "~3.7.6", @@ -15,6 +19,13 @@ "react-timer-mixin": "^0.13.2", "rebound": "^0.0.13" }, + "devDependencies": { + "@babel/cli": "^7.11.5", + "@babel/core": "^7.11.5", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/plugin-proposal-object-rest-spread": "^7.11.0", + "metro-react-native-babel-preset": "^0.56.4" + }, "peerDependencies": { "react-native": "*" } diff --git a/src/NavigatorNavigationBar.js b/src/NavigatorNavigationBar.js index 61d50e9..df3944c 100644 --- a/src/NavigatorNavigationBar.js +++ b/src/NavigatorNavigationBar.js @@ -140,6 +140,9 @@ class NavigatorNavigationBar extends React.Component { var component = this._components[componentName].get(this.props.navState.routeStack[index]); var props = this._getReusableProps(componentName, index); if (component && interpolate[componentName](props.style, amount)) { + if (isNaN(props.style.left)) { + delete props.style.left; + } props.pointerEvents = props.style.opacity === 0 ? 'none' : 'box-none'; component.setNativeProps(props); }