File tree Expand file tree Collapse file tree 3 files changed +53
-1
lines changed
Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 1+ const path = require ( "path" ) ;
2+
3+ module . exports = ( baseConfig , env , config ) => {
4+ config . module . rules . push ( {
5+ test : / \. ( t s | t s x ) $ / ,
6+ use : [
7+ {
8+ loader : require . resolve ( "ts-loader" ) ,
9+ options : {
10+ configFile : "../config/tsconfig.json"
11+ }
12+ }
13+ ]
14+ } ) ;
15+ config . resolve . extensions . push ( ".ts" , ".tsx" ) ;
16+ return config ;
17+ } ;
Original file line number Diff line number Diff line change 11{
22 "name" : " react-scroll-to" ,
3- "version" : " 2.0.4 " ,
3+ "version" : " 2.0.5 " ,
44 "description" : " Scroll to a position using react" ,
55 "main" : " ./dist/react-scroll-to.js" ,
66 "types" : " ./dist/definitions" ,
Original file line number Diff line number Diff line change 1+ import * as React from "react" ;
2+ import { ScrollStory } from "." ;
3+ import { ScrollTo } from "../src" ;
4+
5+ ScrollStory . add ( "Default" , ( ) => (
6+ < div
7+ style = { {
8+ height : "150vh" ,
9+ position : "relative" ,
10+ padding : 20 ,
11+ backgroundImage : "linear-gradient(#FFF, #111)"
12+ } }
13+ >
14+ < ScrollTo >
15+ { ( { scrollTo } ) => (
16+ < React . Fragment >
17+ < button
18+ type = "button"
19+ onClick = { ( ) => scrollTo ( { y : 500 , smooth : true } ) }
20+ >
21+ Scroll Down!
22+ </ button >
23+
24+ < button
25+ type = "button"
26+ style = { { position : "absolute" , left : 20 , bottom : 20 } }
27+ onClick = { ( ) => scrollTo ( { y : 0 , smooth : true } ) }
28+ >
29+ Scroll Up!
30+ </ button >
31+ </ React . Fragment >
32+ ) }
33+ </ ScrollTo >
34+ </ div >
35+ ) ) ;
You can’t perform that action at this time.
0 commit comments