Skip to content

Commit

Permalink
Merge pull request #17 from ambisign-gavin/develop-0.5.0
Browse files Browse the repository at this point in the history
support react-native 0.62.0 and newer version
  • Loading branch information
ambisign-gavin authored Feb 19, 2022
2 parents 61ea2bf + 05f767c commit 587b7d0
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 182 deletions.
61 changes: 42 additions & 19 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,70 @@
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Ignore polyfills
.*/Libraries/polyfills/.*
; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

; Ignore dist
.*/dist/*
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/interface.js
node_modules/react-native/flow/

[options]
emoji=true

module.system=haste
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true
[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.56.0
^0.113.0
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tabWidth": 4,
"semi": true,
"printWidth": 120,
"singleQuote": true,
"trailingComma": "es5"
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ npm i --save react-native-swipe-item

```

- **if you use react-native 0.62.0 and above, please install with `0.5.0`.**

## Usage

You can use the `SwipeButtonsContainer` to wrap buttons that you want to show when users swipe the item, and pass it to props.
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 39 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"name": "react-native-swipe-item",
"version": "0.4.0",
"description": "The swipeale item for react-native",
"main": "dist/index.js",
"type": "index.d.ts",
"scripts": {
"clean": "rimraf dist",
"build:es5": "babel src -d dist",
"build:flow": "flow-copy-source -v src dist",
"prepublish": "npm run clean && npm run build:es5 && npm run build:flow"
},
"peerDependencies": {
"react": ">=15.2.0",
"react-native": ">=0.46.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-jest": "23.6.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react-native": "4.0.1",
"babel-preset-stage-0": "^6.24.1",
"flow-bin": "^0.56.0",
"flow-copy-source": "^2.0.2",
"rimraf": "^2.6.2"
},
"license": "MIT",
"keywords": [
"react-component",
"react-native",
"swipe",
"swipe-item"
],
"author": "Gavin Wang <kuku8990@gmail.com> (https://github.com/ambisign-gavin)",
"repository": {
"type": "git",
"url": "git@github.com:ambisign-gavin/react-native-swipe-item.git"
}
"name": "react-native-swipe-item",
"version": "0.5.0",
"description": "The swipeale item for react-native",
"main": "dist/index.js",
"type": "index.d.ts",
"scripts": {
"clean": "rimraf dist",
"build:es5": "babel src -d dist",
"build:flow": "flow-copy-source -v src dist",
"prepublish": "npm run clean && npm run build:es5 && npm run build:flow"
},
"peerDependencies": {
"react": ">=16.11.0",
"react-native": ">=0.62.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-jest": "23.6.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react-native": "4.0.1",
"babel-preset-stage-0": "^6.24.1",
"flow-bin": "^0.113.0",
"flow-copy-source": "^2.0.2",
"rimraf": "^2.6.2"
},
"license": "MIT",
"keywords": [
"react-component",
"react-native",
"swipe",
"swipe-item"
],
"author": "Gavin Wang <kuku8990@gmail.com> (https://github.com/ambisign-gavin)",
"repository": {
"type": "git",
"url": "git@github.com:ambisign-gavin/react-native-swipe-item.git"
}
}
15 changes: 4 additions & 11 deletions src/component/swipeButtonsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@ import { Animated } from 'react-native';
type Props = {
children?: Node,
style?: mixed,
}
};

export default class SwipeButtonsContainer extends React.Component<Props> {
render() {
const {
style,
children,
...other
} = this.props;
const { style, children, ...other } = this.props;

return (
<Animated.View
style={style}
{...other}
>
<Animated.View style={style} {...other}>
{children}
</Animated.View>
);
}
}
}
Loading

0 comments on commit 587b7d0

Please sign in to comment.