Skip to content

Commit 6421cf5

Browse files
authored
Fix/style sheet compose (#625)
* chore: bump react-native-web in example app * fix: patch style sheet compose usage * chore: update snapshot after style change
1 parent 220dbed commit 6421cf5

File tree

4 files changed

+60
-426
lines changed

4 files changed

+60
-426
lines changed

example-web/package-lock.json

Lines changed: 29 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@types/react-dom": "^18.0.9",
1313
"react": "^18.2.0",
1414
"react-dom": "^18.2.0",
15-
"react-native-web": "^0.18.10",
15+
"react-native-web": "^0.19.12",
1616
"react-scripts": "5.0.1",
1717
"typescript": "^4.9.4",
1818
"web-vitals": "^2.1.4"

package/src/Slider.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, {useState} from 'react';
22
import {
33
Image,
44
Platform,
5-
StyleSheet,
65
AccessibilityActionEvent,
76
ViewProps,
87
ViewStyle,
@@ -230,7 +229,7 @@ const SliderComponent = (
230229
const defaultStyle =
231230
Platform.OS === 'ios' ? styles.defaultSlideriOS : styles.defaultSlider;
232231
const sliderStyle = {zIndex: 1, width: width};
233-
const style = StyleSheet.compose(props.style, defaultStyle);
232+
const style = [props.style, defaultStyle];
234233

235234
const onValueChangeEvent = (event: Event) => {
236235
onValueChange && onValueChange(event.nativeEvent.value);
@@ -287,7 +286,7 @@ const SliderComponent = (
287286
onLayout={(event) => {
288287
setWidth(event.nativeEvent.layout.width);
289288
}}
290-
style={[styles, style, {justifyContent: 'center'}]}>
289+
style={[style, {justifyContent: 'center'}]}>
291290
{props.StepMarker || !!props.renderStepNumber ? (
292291
<StepsIndicator
293292
options={options}

0 commit comments

Comments
 (0)