Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions shared/repro/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import {View, Text, DynamicColorIOS} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';

const Stack = createNativeStackNavigator();

function Screen() {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text>Test Screen</Text>
</View>
);
}

export default function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={Screen}
options={{
headerStyle: {
backgroundColor: DynamicColorIOS({
light: 'green',
dark: 'blue',
}),
},
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
40 changes: 40 additions & 0 deletions shared/repro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Repro Project

Minimal React Native project to reproduce DynamicColorIOS header backgroundColor issue.

## Setup

1. Initialize a new React Native project:
```bash
npx react-native@0.81.5 init ReproApp
cd ReproApp
```

2. Install required dependencies:
```bash
npm install react-native-screens@4.20.0 @react-navigation/native-stack@7.9.1 @react-navigation/native react-native-safe-area-context
```

3. Replace `App.js` with the contents from this repo's `App.js`

4. Replace `index.js` with the contents from this repo's `index.js`

5. For iOS:
```bash
cd ios
pod install
cd ..
```

6. Run the app:
```bash
npx react-native run-ios
```

## What to Test

The header backgroundColor uses `DynamicColorIOS` with:
- `light: 'green'`
- `dark: 'blue'`

Switch between light and dark mode in iOS settings to verify the header color changes.
3 changes: 3 additions & 0 deletions shared/repro/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {AppRegistry} from 'react-native';
import App from './App';
AppRegistry.registerComponent('ReproApp', () => App);
13 changes: 13 additions & 0 deletions shared/repro/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "repro",
"version": "1.0.0",
"private": true,
"dependencies": {
"@react-navigation/native": "7.1.27",
"@react-navigation/native-stack": "7.9.1",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-safe-area-context": "5.6.2",
"react-native-screens": "4.20.0"
}
}