(component, wrapper)
| 259 | export const withStyle = withStyleDeep; |
| 260 | |
| 261 | export const withWrapper: WithWrapperFn = (component, wrapper) => { |
| 262 | const styletron = component.__STYLETRON__; |
| 263 | |
| 264 | if (__DEV__) { |
| 265 | if (!styletron) { |
| 266 | /* eslint-disable no-console */ |
| 267 | console.warn( |
| 268 | "The first parameter to `withWrapper` must be a styled component (without extra wrappers).", |
| 269 | ); |
| 270 | /* eslint-enable no-console */ |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | const composed = { |
| 275 | getInitialStyle: styletron.getInitialStyle, |
| 276 | base: styletron.base, |
| 277 | driver: styletron.driver, |
| 278 | wrapper: wrapper, |
| 279 | reducers: styletron.reducers, |
| 280 | }; |
| 281 | |
| 282 | if (__BROWSER__ && __DEV__) { |
| 283 | addDebugMetadata(composed, 2); |
| 284 | } |
| 285 | |
| 286 | return createStyledElementComponent(composed); |
| 287 | }; |
| 288 | |
| 289 | export function autoComposeShallow<Props>( |
| 290 | styletron: Styletron, |
no test coverage detected