Skip to content

Commit f3ba1b7

Browse files
committed
fix
1 parent 3dabaa4 commit f3ba1b7

File tree

6 files changed

+15331
-22
lines changed

6 files changed

+15331
-22
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ export default class MyComponent extends Component {
108108
<>
109109
<ScrollTo>
110110
{({ scrollTo }) => (
111-
<a onClick={() => scrollTo({ ref: this.myRef, x: 20, y: 500 })}>Scroll to Bottom</a>
111+
<a onClick={() => scrollTo({ ref: this.myRef, x: 20, y: 500 })}>
112+
Scroll to Bottom
113+
</a>
112114
)}
113115
</ScrollTo>
114116

115-
<div ref={this.myRef}>
116-
My Element
117-
</div>
117+
<div ref={this.myRef}>My Element</div>
118118
</>
119119
);
120120
}
@@ -156,7 +156,9 @@ export default ScrollToHOC(function(props) {
156156
return (
157157
<div>
158158
<ScrollArea id="foo" style={{ height: 1000 }}>
159-
<a onClick={() => props.scrollTo({ id: "foo", y: 500 })}>Scroll to Bottom</a>
159+
<a onClick={() => props.scrollTo({ id: "foo", y: 500 })}>
160+
Scroll to Bottom
161+
</a>
160162
</ScrollArea>
161163

162164
<ScrollArea style={{ height: 1000 }}>
@@ -169,12 +171,12 @@ export default ScrollToHOC(function(props) {
169171
170172
### Types:
171173
172-
* **Typescript** definitions are built in
173-
* **Flow** is currently not support (Open for PRs!)
174+
- **Typescript** definitions are built in
175+
- **Flow** is currently not support (Open for PRs!)
174176
175177
### 2.0 Changes
176178
177-
* v2.0 has a new API for controlling scrolling. Instead of taking two arguments, x and y, the ScrollTo component now takes an object.
179+
- v2.0 has a new API for controlling scrolling. Instead of taking two arguments, x and y, the ScrollTo component now takes an object.
178180
179181
```js
180182
scrollTo({
@@ -188,7 +190,13 @@ scrollTo({
188190
189191
Mixing and matching these options give different results.
190192
191-
* The `scrollById` function has been deprecated in favor of the `id` field in `scrollTo`
193+
- The `scrollById` function has been deprecated in favor of the `id` field in `scrollTo`
194+
195+
### Smooth Scrolling Not Working?
196+
197+
Some browsers don't natively support smooth scroll. Checkout adding a polyfill like `smoothscroll-polyfill` to fix the issue.
198+
199+
`npm install smoothscroll-polyfill`
192200

193201
## Contributors
194202

@@ -209,6 +217,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
209217

210218
<!-- markdownlint-enable -->
211219
<!-- prettier-ignore-end -->
220+
212221
<!-- ALL-CONTRIBUTORS-LIST:END -->
213222

214223
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

config/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"noImplicitAny": false,
1818
"pretty": true,
1919

20-
"declaration": false
20+
"declaration": false,
21+
"sourceMap": true
2122
},
2223
"include": ["../src/**/*"],
2324
"exclude": [

config/webpack.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ module.exports = {
2222
root: "React",
2323
commonjs2: "react",
2424
commonjs: "react",
25-
amd: "react"
25+
amd: "react",
26+
umd: "react"
27+
},
28+
"react-dom": {
29+
root: "ReactDOM",
30+
commonjs2: "react-dom",
31+
commonjs: "react-dom",
32+
amd: "react-dom",
33+
umd: "react-dom"
2634
}
2735
}
2836
],

0 commit comments

Comments
 (0)