Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

component is not working #20

Open
msedek opened this issue Apr 18, 2018 · 8 comments
Open

component is not working #20

msedek opened this issue Apr 18, 2018 · 8 comments

Comments

@msedek
Copy link

msedek commented Apr 18, 2018

TypeError: Cannot read property 'Y' of undefined

3 | import {ScrollBox, ScrollAxes, FastTrack} from 'react-scroll-box'; // ES6
4 |
5 | const TestContainer = () => (

6 | <ScrollBox style={{height: '200px'}} axes={ScrollAxes.Y} fastTrack={FastTrack.PAGING}>
7 | Place any content here.
8 |
9 | );

im using the npm install react-scroll-box with all the latest versions of create-react-app and node.js and everythign the latest.. what gives?.. working on ubuntu 18.04, also tried installing with yarn... react just wont get the component

@dmarkin
Copy link

dmarkin commented Apr 23, 2018

Yes, for me to. Will be component supported?

@nadunindunil
Copy link

me too same error.

@tlouth19
Copy link

tlouth19 commented May 1, 2018

Same error with v0.3.5 and react 16.2.0

@sylvainbx
Copy link

sylvainbx commented May 31, 2018

Same problem here with react 16.4.0 and react-scroll-box 0.3.5

@Haldor9000
Copy link

Works for me (react 16.4.1 react-scroll-box 0.3.5):

import {ScrollBox} from 'react-scroll-box';

<ScrollBox style={{width: '240px', height: '400px'}}
disableScrollX={true}
permitHandleDragInterruption={false}>

Some long content here....

</ScrollBox>

@ebrearley
Copy link

Hey guys, looks like ScrollAxis was removed without the readme being updated.

Since ScrollAxis is no longer present, using the example:

<ScrollBox style={{height: '200px'}} axes={ScrollAxes.Y} fastTrack={FastTrack.PAGING}>
  Place any content here.
</ScrollBox>

will fail because ScrollAxes is undefined, resulting in the TypeError: Cannot read property 'Y' of undefined error.

After a quick skim through the code, @Haldor9000's comment is correct where he removed the axis prop and used disableScrollX and/or disableScrollY props instead.

A working example would look like:

import { ScrollBox, FastTrack } from 'react-scroll-box'; // ES6
 
<ScrollBox style={{height: '200px'}} fastTrack={FastTrack.PAGING} disableScrollX>
  Place any content here.
</ScrollBox>

@punkscience
Copy link

punkscience commented Feb 28, 2019

I am getting a different issue:

Could not find a declaration file for module 'react-scroll-box'.
.../node_modules/react-scroll-box/target/out/index.js' implicitly has an 'any' type.
Try npm install @types/react-scroll-box if it exists or add a new declaration (.d.ts) file containing declare module 'react-scroll-box';ts(7016)
Could not find a declaration file for module 'react-scroll-box'.
.../node_modules/react-scroll-box/target/out/index.js' implicitly has an 'any' type.
Try npm install @types/react-scroll-box if it exists or add a new declaration (.d.ts) file containing declare module 'react-scroll-box';ts(7016)

@byyoungjin
Copy link

FastTrack also not defined.. I think this library is not managed anymore

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants