-
Notifications
You must be signed in to change notification settings - Fork 38
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
Try npm install @types/react-scroll-to-bottom #81
Comments
We are not a TypeScript component, thus, we are not publishing declarations (a.k.a. typings, or Can your application relax to support React components written in JavaScript? |
@compulim You can publish typings even without writing your component in TypeScript. The way you do this is simple - add a .d.ts file with the type definitions, and then point to this file in your package.json using the I've created a pull request that should do the trick: |
I do really wireting with the javascript/ typescript component of react application, I can relax typescript rules. Thank you very much all |
I'm feel truly, this change is very very helpful to us! |
While we are waiting for the PR #96 to be resolved. You can add this to your code to satisfy the great work @justinbhopper did to a declare module 'react-scroll-to-bottom' {
import * as React from 'react';
interface ReactScrollToBottomProps {
checkInterval?: number;
className?: string;
debounce?: number;
followButtonClassName?: string;
mode?: string;
scrollViewClassName?: string;
children: React.ReactNode;
debug?: boolean;
}
interface ScrollOptions {
behavior: ScrollBehavior;
}
interface FunctionContextProps {
scrollTo: (scrollTo: number, options: ScrollOptions) => void;
scrollToBottom: (options: ScrollOptions) => void;
scrollToEnd: (options: ScrollOptions) => void;
scrollToStart: (options: ScrollOptions) => void;
scrollToTop: (options: ScrollOptions) => void;
}
const FunctionContext: React.Context<FunctionContextProps>;
export default class ScrollToBottom extends React.PureComponent<ReactScrollToBottomProps> {}
} |
Hi flow!I
I have a problem! How to use this component in the application with React and typescript?
I install and create simple chat app when run command
npm i react-scroll-to-bottom
result OK, no problem.But when I run command
npm start
result this problem\error:The text was updated successfully, but these errors were encountered: