@@ -42,6 +42,7 @@ function Stick({
4242 autoFlipHorizontally,
4343 autoFlipVertically,
4444 onClickOutside,
45+ ...rest
4546} : PropsT ) {
4647 const [ width , setWidth ] = useState ( 0 )
4748 const [ containerNestingKeyExtension ] = useState ( ( ) => uniqueId ( ) )
@@ -125,14 +126,27 @@ function Stick({
125126 getModifiers ( { position : resolvedPosition , align : resolvedAlign } )
126127 )
127128
129+ const handleReposition = useCallback ( ( ) => {
130+ if ( nodeRef . current && anchorRef . current ) {
131+ checkAlignment ( nodeRef . current , anchorRef . current )
132+ }
133+ } , [ checkAlignment ] )
134+
128135 if ( ! node ) {
129- return children
136+ const Component = component || 'div'
137+
138+ return (
139+ < StickContext . Provider value = { nestingKey } >
140+ < Component { ...rest } > { children } </ Component >
141+ </ StickContext . Provider >
142+ )
130143 }
131144
132145 if ( inline ) {
133146 return (
134147 < StickContext . Provider value = { nestingKey } >
135148 < StickInline
149+ { ...rest }
136150 position = { resolvedPosition }
137151 align = { resolvedAlign }
138152 node = {
@@ -162,6 +176,7 @@ function Stick({
162176 return (
163177 < StickContext . Provider value = { nestingKey } >
164178 < StickPortal
179+ { ...rest }
165180 updateOnAnimationFrame = { ! ! updateOnAnimationFrame }
166181 transportTo = { transportTo }
167182 component = { component }
@@ -188,11 +203,7 @@ function Stick({
188203 style = { resolvedStyle }
189204 nestingKey = { nestingKey }
190205 containerRef = { containerRef }
191- onReposition = { ( ) => {
192- if ( nodeRef . current && anchorRef . current ) {
193- checkAlignment ( nodeRef . current , anchorRef . current )
194- }
195- } }
206+ onReposition = { handleReposition }
196207 >
197208 { children }
198209 </ StickPortal >
0 commit comments