Skip to content

Commit

Permalink
fix: add ref to the public interface
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed May 1, 2022
1 parent dc56938 commit db99c0e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .size.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
{
"name": "dist/es2015/index.js",
"passed": true,
"size": 2889
"size": 2903
},
{
"name": "dist/es2015/sidecar.js",
"passed": true,
"size": 2373
"size": 2385
},
{
"name": "dist/es2015/UI.js",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
],
"repository": "https://github.com/theKashey/react-remove-scroll",
"dependencies": {
"react-remove-scroll-bar": "^2.3.0",
"react-remove-scroll-bar": "^2.3.1",
"react-style-singleton": "^2.2.0",
"tslib": "^2.0.0",
"use-callback-ref": "^1.3.0",
Expand Down
3 changes: 3 additions & 0 deletions src/UI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import {
RemoveScrollEffectCallbacks,
IRemoveScrollUIProps,
RemoveScrollUIType,
IRemoveScrollSelfProps,
} from './types';

export type { IRemoveScrollSelfProps, RemoveScrollUIType };

const nothing = () => {
return;
};
Expand Down
12 changes: 4 additions & 8 deletions src/types.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { RefObject } from 'react';
import { Ref, RefObject } from 'react';
import { ForwardRefExoticComponent } from 'react';
import { RefAttributes } from 'react';

Expand Down Expand Up @@ -34,6 +34,7 @@ export interface ChildrenForward {
}

export interface IRemoveScrollSelfProps {
ref?: Ref<HTMLElement>;
/**
* disables "event isolation" (suppressing of events happening outside of the Lock)
* @default false
Expand Down Expand Up @@ -62,7 +63,6 @@ export interface IRemoveScrollSelfProps {
*/
removeScrollBar?: boolean;


className?: string;
style?: React.CSSProperties;

Expand All @@ -77,8 +77,7 @@ export interface IRemoveScrollSelfProps {
as?: string | React.ElementType;
}

export type IRemoveScrollProps = IRemoveScrollSelfProps &
(ChildrenForward | ChildrenNode);
export type IRemoveScrollProps = IRemoveScrollSelfProps & (ChildrenForward | ChildrenNode);

export type IRemoveScrollUIProps = IRemoveScrollProps & {
sideCar: React.FC<any>;
Expand All @@ -104,10 +103,7 @@ interface WithClassNames {
};
}

type RefForwarded<T> = ForwardRefExoticComponent<
T & RefAttributes<HTMLElement>
> &
WithClassNames;
type RefForwarded<T> = ForwardRefExoticComponent<T & RefAttributes<HTMLElement>> & WithClassNames;

export type RemoveScrollType = RefForwarded<IRemoveScrollProps>;

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10385,10 +10385,10 @@ react-refresh@^0.11.0:
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.11.0.tgz#77198b944733f0f1f1a90e791de4541f9f074046"
integrity sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==

react-remove-scroll-bar@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.0.tgz#4f1c8442e4a8bbf98f0cd7ba30fdaf7bf5bcffe5"
integrity sha512-v2vf8kgrRph5FQeLVZjSOmM0g3ZiBxwMk98VXhsiJDSPeRDUaXJrzYDk2Hhoe6qLggrhWtAXJZVxUwXmRXa93g==
react-remove-scroll-bar@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.1.tgz#9f13b05b249eaa57c8d646c1ebb83006b3581f5f"
integrity sha512-IvGX3mJclEF7+hga8APZczve1UyGMkMG+tjS0o/U1iLgvZRpjFAQEUBJ4JETfvbNlfNnZnoDyWJCICkA15Mghg==
dependencies:
react-style-singleton "^2.2.0"
tslib "^2.0.0"
Expand Down

0 comments on commit db99c0e

Please sign in to comment.