react-native-segmented-control/segmented-control

[BUG]: Labels not rendering when mounted.

agusvazquez opened this issue · 1 comments

Hello! I am experiencing the following issue only when the phone is in dark theme and iOS only. Web and android work fine.

I provided 2 videos, one with styling, and the other one without any style props.

Also tried setting appearance="dark" but still facing the same issue.

"react-native": "0.73.2",
"@react-native-segmented-control/segmented-control": "^2.5.0",

iOS 17.2
xCode version 15.2

Attaching source code.

import SegmentedControl from "@react-native-segmented-control/segmented-control";

const Test = () => {
  const CHART_OPTIONS = ["Week", "30 d", "90 d", "Year"];
  const [chartIndex, setChartIndex] = useState<number>(0);
  
  return <SegmentedControl
    values={CHART_OPTIONS}
    selectedIndex={chartIndex}
    onChange={(event) => {
      setChartIndex(event.nativeEvent.selectedSegmentIndex);
    }} />
}

export default Test
appVideo.mov
appVideo2.mov

Simulator Screenshot - iPhone 15 Pro - 2024-01-18 at 12 36 46

EDIT: I just tested it with light theme and still facing the same issue.

Thank you!

Closing because the bug was on my end.
[[UILabel appearance] setFont:[UIFont fontWithName:@"Inter-Regular" size:[UILabel appearance].font.pointSize]];
Somehow UILabel appearance is null.

Apologies.