Skip to content

Version 4 #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build/
dist/
node_modules/
.snapshots/
*.min.js
30 changes: 18 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"standard",
"standard-react",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended"
"prettier/standard",
"prettier/react",
"plugin:@typescript-eslint/eslint-recommended"
],
"plugins": ["@typescript-eslint", "react", "react-hooks", "jsx-a11y"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
"env": {
"node": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaVersion": 2020,
"ecmaFeatures": {
"legacyDecorators": true,
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
"version": "16"
}
},
"rules": {
"space-before-function-paren": 0,
"react/prop-types": 0,
"react/jsx-handler-names": 0,
"react/jsx-fragments": 0,
"react/no-unused-prop-types": 0,
"import/export": 0
}
}
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language: node_js
node_js:
- 9
- 8
- 12
- 10
2 changes: 0 additions & 2 deletions example/.env

This file was deleted.

7 changes: 4 additions & 3 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Example for react-bottom-scroll-listener
This example was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

Install dependencies: `yarn`
Start development server: `yarn start`
It is linked to the react-bottom-scroll-listener-2 package in the parent directory for development purposes.

You can run `yarn install` and then `yarn start` to test your package.
34 changes: 15 additions & 19 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,25 @@
"license": "MIT",
"private": true,
"dependencies": {
"prop-types": "^15.7.2",
"react": "link:../node_modules/react",
"react-bottom-scroll-listener": "link:..",
"react-dom": "link:../node_modules/react-dom",
"react-scripts": "^3.1.2",
"react-toggle": "^4.0.2"
"react-scripts": "link:../node_modules/react-scripts",
"react-toggle": "^4.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
"start": "node ../node_modules/react-scripts/bin/react-scripts.js start",
"build": "node ../node_modules/react-scripts/bin/react-scripts.js build",
"test": "node ../node_modules/react-scripts/bin/react-scripts.js test",
"eject": "node ../node_modules/react-scripts/bin/react-scripts.js eject"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
Binary file added example/public/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions example/src/HookExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const HookExample = ({ alertOnBottom }) => {
console.log('I am at bottom! ' + Math.round(performance.now()))

if (alertOnBottom) {
alert('Bottom hit! Too slow? Reduce "debounce" value in props')
alert('Bottom hit!')
}
}, [alertOnBottom])

const handleContainerOnBottom = useCallback(() => {
console.log('I am at bottom in optional container! ' + Math.round(performance.now()))

if (alertOnBottom) {
alert('Bottom of this container hit! Too slow? Reduce "debounce" value in props')
alert('Bottom of this container hit!')
}
}, [alertOnBottom])

Expand Down
Loading