diff --git a/package.json b/package.json index c873669..39e637d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "private": true, + "name":"react-sticky-box", "workspaces": [ "packages/*" ], diff --git a/packages/react-sticky-box/src/index.tsx b/packages/react-sticky-box/src/index.tsx index 7ab6ccb..c8683ba 100644 --- a/packages/react-sticky-box/src/index.tsx +++ b/packages/react-sticky-box/src/index.tsx @@ -1,4 +1,4 @@ -import {ComponentProps, useEffect, useState} from "react"; +import React, {ComponentProps, useEffect, useState} from "react"; const getScrollParent = (node: HTMLElement) => { let parent: HTMLElement | null = node; @@ -409,11 +409,7 @@ const StickyBox = (props: StickyBoxCompProps) => { const {offsetTop, offsetBottom, bottom, children, className, style} = props; const ref = useStickyBox({offsetTop, offsetBottom, bottom}); - return ( -
- {children} -
- ); + return React.createElement('div',{className, style, ref, children}) }; export default StickyBox;