Skip to content

Commit

Permalink
Fix/style sheet compose (#625)
Browse files Browse the repository at this point in the history
* chore: bump react-native-web in example app

* fix: patch style sheet compose usage

* chore: update snapshot after style change
  • Loading branch information
draggie authored Aug 29, 2024
1 parent 220dbed commit 6421cf5
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 426 deletions.
52 changes: 29 additions & 23 deletions example-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@types/react-dom": "^18.0.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native-web": "^0.18.10",
"react-native-web": "^0.19.12",
"react-scripts": "5.0.1",
"typescript": "^4.9.4",
"web-vitals": "^2.1.4"
Expand Down
5 changes: 2 additions & 3 deletions package/src/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, {useState} from 'react';
import {
Image,
Platform,
StyleSheet,
AccessibilityActionEvent,
ViewProps,
ViewStyle,
Expand Down Expand Up @@ -230,7 +229,7 @@ const SliderComponent = (
const defaultStyle =
Platform.OS === 'ios' ? styles.defaultSlideriOS : styles.defaultSlider;
const sliderStyle = {zIndex: 1, width: width};
const style = StyleSheet.compose(props.style, defaultStyle);
const style = [props.style, defaultStyle];

const onValueChangeEvent = (event: Event) => {
onValueChange && onValueChange(event.nativeEvent.value);
Expand Down Expand Up @@ -287,7 +286,7 @@ const SliderComponent = (
onLayout={(event) => {
setWidth(event.nativeEvent.layout.width);
}}
style={[styles, style, {justifyContent: 'center'}]}>
style={[style, {justifyContent: 'center'}]}>
{props.StepMarker || !!props.renderStepNumber ? (
<StepsIndicator
options={options}
Expand Down
Loading

0 comments on commit 6421cf5

Please sign in to comment.