fix(react-native): always assign checkout colors on setConfig - #597
Draft
kieran-osgood-shopify wants to merge 4 commits into
Draft
fix(react-native): always assign checkout colors on setConfig#597kieran-osgood-shopify wants to merge 4 commits into
kieran-osgood-shopify wants to merge 4 commits into
Conversation
kieran-osgood-shopify
force-pushed
the
kieran-osgood/07-16-featupdatereact-nativetousenewnativecolorschemeproperties
branch
from
August 6, 2026 13:04
b190898 to
caaee4a
Compare
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
|
||
| const updatedColors = getColors( | ||
| appConfig.colorScheme, | ||
| Appearance.getColorScheme(), |
Contributor
Author
There was a problem hiding this comment.
this was a non-reactive value meaning it didn't trigger re-renders when system color scheme changed
kieran-osgood-shopify
changed the base branch from
kieran-osgood/07-16-featupdatereact-nativetousenewnativecolorschemeproperties
to
graphite-base/597
August 6, 2026 13:12
kieran-osgood-shopify
force-pushed
the
graphite-base/597
branch
from
August 6, 2026 13:34
caaee4a to
1dc6b16
Compare
kieran-osgood-shopify
force-pushed
the
kieran-osgood/rn-reset-checkout-colors
branch
from
August 6, 2026 13:34
486c85a to
76494fb
Compare
kieran-osgood-shopify
changed the base branch from
graphite-base/597
to
kieran-osgood/07-16-featupdatereact-nativetousenewnativecolorschemeproperties
August 6, 2026 13:35
kieran-osgood-shopify
changed the base branch from
kieran-osgood/07-16-featupdatereact-nativetousenewnativecolorschemeproperties
to
graphite-base/597
August 6, 2026 17:21
The iOS bridge wrote a color only when `setConfig` supplied it. The library configuration is process wide, so a call that omitted a color kept the value from the previous call. An app that moved to the automatic color scheme, which sends no `colors.ios`, therefore kept the background color from the last explicit light or dark call. The bridge now uses `ShopifyCheckoutKit.configure` one time and always assigns `tintColor`, `backgroundColor` and `closeButtonTintColor`. When the config omits a color, the bridge restores the value the host application held before React Native first configured the library. The sample also seeded the theme store without the app config store, so `ThemeProvider` pinned the whole app appearance with `Appearance.setColorScheme`. `useColorScheme` then stopped following the operating system. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Assisted-By: devx/7d95f963-6589-404b-8a36-2fc413db8f1d
The sample sent a nested light and dark color map for the automatic scheme on Android, and no map on iOS. The two platforms therefore disagreed. The sample now sends no color overrides for automatic, so each native SDK picks its own idiomatic colors. `getCheckoutKitColors` holds that rule as a pure function next to the other color helpers in `Theme.tsx`, so a unit test can cover it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Assisted-By: devx/7d95f963-6589-404b-8a36-2fc413db8f1d
`appearanceFor` gated the color override path on a check that requires
four top level color keys. The automatic scheme sends the nested
`{light, dark}` shape, so the check always failed and Android dropped
the overrides. `getColors` already uses the nested aware check, so the
outer gate is now removed and `getColors` decides alone.
An Android app that sends the automatic scheme with valid light and dark
colors now receives them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assisted-By: devx/7d95f963-6589-404b-8a36-2fc413db8f1d
`checkoutKitConfigDefaults.colorScheme` held `light` while `defaultAppConfig`, the `ThemeProvider` default value and the fallback at the `ConfigProvider` call site all held `automatic`. The odd one out won, because it feeds the `ConfigProvider` config prop. The field is now gone, so the seed resolves to `automatic` through the existing fallback. The spread at the `checkoutKitConfig` call site never used the value, because the theme config always overrides `colorScheme`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Assisted-By: devx/7d95f963-6589-404b-8a36-2fc413db8f1d
kieran-osgood-shopify
force-pushed
the
kieran-osgood/rn-reset-checkout-colors
branch
from
August 6, 2026 18:20
368df42 to
9f18066
Compare
kieran-osgood-shopify
force-pushed
the
graphite-base/597
branch
from
August 6, 2026 18:20
1dc6b16 to
d48982a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What am I fixing
lightdark&storefront.Simulator Screen Recording - iPhone 15 Pro - 2026-08-06 at 13.33.22.mov (uploaded via Graphite)
How
setConfigsupplied that key, this meant when configure was recalled with a null value, it keps the old value.ShopifyCheckoutKit.configurationis process wide, so an omitted key kept the previous value. Theautomaticandstorefrontbranches of the sample send nocolors.ios, so they inherited the last light or dark background. This behaviour came in with the v3 import and stayed latent, because the v3 sample always sent a staticcolors.iosblock, including forautomatic.setConfignow callsShopifyCheckoutKit.configureone time and always assignstintColor,backgroundColorandcloseButtonTintColor. When the config omits a color, the bridge writes the value the host application held before React Native first configured the library. Aprivate static letcaptures that value, so it survives a Metro reload.After
This matches the Android bridge, which already rebuilds the whole appearance per call.
How to test
Review the test video above and perform similar steps, alternating the theme toggle in settings and opening checkout, we should retain good contrast and match theme for the background color of the webview, the header, the title, and the close icon.
You can toggle the shortcut on simulator (ios) with cmd+shift+A - android doesn't have a keyboard shortcut but you can find it in the system tray
Before you merge
Important
platforms/react-native/README.md)🤖 Generated with Claude Code