Skip to content

Commit 53bbac9

Browse files
authored
fix: pass styles on correctly (#24)
1 parent 77d4115 commit 53bbac9

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/Stick.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ function Stick({
137137

138138
return (
139139
<StickContext.Provider value={nestingKey}>
140-
<Component {...rest}>{children}</Component>
140+
<Component {...resolvedStyle} {...rest}>
141+
{children}
142+
</Component>
141143
</StickContext.Provider>
142144
)
143145
}
@@ -149,6 +151,7 @@ function Stick({
149151
{...rest}
150152
position={resolvedPosition}
151153
align={resolvedAlign}
154+
style={resolvedStyle}
152155
node={
153156
<StickNode
154157
width={width}

src/StickInline.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
// @flow
22
import React from 'react'
33
import { type HOC } from 'recompose'
4-
import { type Substyle, defaultStyle } from 'substyle'
4+
import { defaultStyle } from 'substyle'
55

66
import { type StickInlinePropsT } from './flowTypes'
77
import { getModifiers } from './utils'
88

9-
type PropsT = {|
10-
...StickInlinePropsT,
11-
12-
style: Substyle,
13-
|}
14-
159
function StickInline({
1610
node,
1711
children,
1812
style,
1913
component,
2014
containerRef,
2115
nestingKey,
16+
align,
17+
position,
2218
...rest
23-
}: PropsT) {
19+
}: StickInlinePropsT) {
2420
const Component = component || 'div'
2521
return (
2622
<Component

src/flowTypes.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ type SpecificStickBasePropsT = {|
7474
node: ?Node,
7575

7676
component: ?string,
77+
style: Substyle,
7778

7879
nestingKey: string,
7980

@@ -94,8 +95,6 @@ export type StickPortalPropsT = {|
9495

9596
position: PositionT,
9697

97-
style: Substyle,
98-
9998
updateOnAnimationFrame: boolean,
10099

101100
onReposition: (nodeRef: HTMLElement) => void,

0 commit comments

Comments
 (0)