Skip to content

Commit 4d35e37

Browse files
authored
Merge pull request #104 from ganderzz/feature/#99
Remove create-react-context and start v3.0.0 development
2 parents 42964d0 + 2cef97a commit 4d35e37

File tree

8 files changed

+126
-141
lines changed

8 files changed

+126
-141
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Dylan
3+
Copyright (c) 2017 Dylan Paulus
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

config/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
context: path.resolve(__dirname, ".."),
1616
resolve: {
1717
modules: [path.resolve(__dirname, "..", "src"), "node_modules"],
18-
extensions: [".js", ".jsx"]
18+
extensions: [".js", ".jsx", ".ts", ".tsx"]
1919
},
2020
externals: [
2121
{

package.json

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scroll-to",
3-
"version": "2.0.9",
3+
"version": "3.0.0-beta.1",
44
"description": "Scroll to a position using react",
55
"main": "./dist/react-scroll-to.js",
66
"types": "./dist/definitions",
@@ -15,23 +15,6 @@
1515
"storybook": "start-storybook -p 9001 -c .storybook",
1616
"build:docs": "build-storybook -c .storybook -o docs"
1717
},
18-
"repository": {
19-
"type": "git",
20-
"url": "git+https://github.com/ganderzz/react-scroll-to.git"
21-
},
22-
"keywords": [
23-
"react",
24-
"scroll",
25-
"to",
26-
"window",
27-
"position"
28-
],
29-
"author": "Dylan Paulus",
30-
"license": "MIT",
31-
"bugs": {
32-
"url": "https://github.com/ganderzz/react-scroll-to/issues"
33-
},
34-
"homepage": "https://github.com/ganderzz/react-scroll-to#readme",
3518
"peerDepedencies": {
3619
"react": ">= ^16.0.0"
3720
},
@@ -41,17 +24,18 @@
4124
"@babel/preset-env": "7.4.5",
4225
"@babel/preset-react": "7.0.0",
4326
"@storybook/react": "5.0.11",
44-
"all-contributors-cli": "6.6.0",
27+
"@testing-library/react": "^8.0.1",
28+
"all-contributors-cli": "6.6.1",
4529
"babel-core": "7.0.0-bridge.0",
4630
"babel-jest": "24.8.0",
4731
"babel-loader": "8.0.6",
48-
"copy-webpack-plugin": "4.6.0",
32+
"copy-webpack-plugin": "5.0.3",
4933
"enzyme": "3.7.0",
5034
"enzyme-adapter-react-16": "1.6.0",
5135
"eslint": "5.16.0",
5236
"eslint-config-airbnb": "17.1.0",
5337
"eslint-config-prettier": "4.3.0",
54-
"eslint-plugin-import": "2.17.2",
38+
"eslint-plugin-import": "2.17.3",
5539
"eslint-plugin-jsx-a11y": "6.2.1",
5640
"eslint-plugin-react": "7.13.0",
5741
"husky": "2.3.0",
@@ -60,11 +44,28 @@
6044
"prettier": "1.17.1",
6145
"react": "16.8.6",
6246
"react-dom": "16.8.6",
63-
"react-testing-library": "7.0.1",
64-
"ts-loader": "^6.0.1",
47+
"ts-loader": "6.0.2",
48+
"typescript": "^3.5.1",
6549
"webpack": "4.32.1",
6650
"webpack-cli": "3.3.2"
6751
},
52+
"repository": {
53+
"type": "git",
54+
"url": "git+https://github.com/ganderzz/react-scroll-to.git"
55+
},
56+
"keywords": [
57+
"react",
58+
"scroll",
59+
"to",
60+
"window",
61+
"position"
62+
],
63+
"author": "Dylan Paulus",
64+
"license": "MIT",
65+
"bugs": {
66+
"url": "https://github.com/ganderzz/react-scroll-to/issues"
67+
},
68+
"homepage": "https://github.com/ganderzz/react-scroll-to#readme",
6869
"jest": {
6970
"setupFiles": [
7071
"./src/tests/setup/shim.js",
@@ -96,8 +97,5 @@
9697
"hooks": {
9798
"pre-commit": "lint-staged"
9899
}
99-
},
100-
"dependencies": {
101-
"create-react-context": "^0.2.3"
102100
}
103101
}

src/ScrollTo.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import React, { Component, isValidElement } from "react";
22
import ReactDOM from "react-dom";
33
import { relative } from "./utilities/relative";
4-
import createReactContext from "create-react-context";
54

65
/* istanbul ignore next */
7-
export const ScrollToContext = React.createContext
8-
? React.createContext({}) /* istanbul ignore next */
9-
: createReactContext({});
6+
export const ScrollToContext = React.createContext({});
107

118
/**
129
* Component that uses render props to inject

src/tests/ScrollArea.spec.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { render } from "react-testing-library";
2+
import { render } from "@testing-library/react";
33
import { ScrollToContext } from "../ScrollTo";
44
import ScrollArea, { createRefPoly } from "../ScrollArea";
55

src/tests/ScrollTo.spec.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
2-
import { render, cleanup, fireEvent } from "react-testing-library";
2+
import { render, cleanup, fireEvent } from "@testing-library/react";
33
import { shallow } from "enzyme";
4-
import createReactContext from "create-react-context";
54
import ScrollTo from "../ScrollTo";
65

76
afterEach(cleanup);
@@ -255,7 +254,7 @@ describe("Test render prop.", () => {
255254
});
256255

257256
it("Should handle using the relative() function", () => {
258-
const refDOM = React.createRef ? React.createRef() : createReactContext();
257+
const refDOM = React.createRef();
259258
const { getByText } = render(
260259
<ScrollTo>
261260
{({ scrollTo, relative }) => (

src/tests/ScrollToHOC.spec.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { render, fireEvent, cleanup } from "react-testing-library";
2+
import { render, fireEvent, cleanup } from "@testing-library/react";
33
import ScrollToHOC from "../ScrollToHOC";
44

55
afterAll(cleanup);

0 commit comments

Comments
 (0)