Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle cssvars in native settings #500

Merged
merged 1 commit into from
Jan 20, 2025
Merged
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
12 changes: 8 additions & 4 deletions cxx/hybridObjects/HybridStyleSheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ void HybridStyleSheet::parseSettings(jsi::Runtime &rt, jsi::Object settings) {
return;
}

if (propertyName == "CSSVars") {
return;
}

helpers::assertThat(rt, false, "StyleSheet.configure's settings received unexpected key: '" + std::string(propertyName) + "'");
});
}
Expand Down Expand Up @@ -255,13 +259,13 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
auto dependentStyleSheets = registry.getStyleSheetsToRefresh(rt, dependencies);

parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets, std::nullopt);

// we need to stop here if there is nothing to update at the moment,
// but we need to compute dependentStyleSheets
if (dependencyMap.empty()) {
return;
}

parser.rebuildShadowLeafUpdates(rt, dependencyMap);

this->notifyJSListeners(dependencies);
Expand Down Expand Up @@ -306,13 +310,13 @@ void HybridStyleSheet::onPlatformNativeDependenciesChange(std::vector<UnistyleDe
auto dependentStyleSheets = registry.getStyleSheetsToRefresh(rt, unistyleDependencies);

parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets, miniRuntime);

// we need to stop here if there is nothing to update at the moment,
// but we need to compute dependentStyleSheets
if (dependencyMap.empty()) {
return;
}

parser.rebuildShadowLeafUpdates(rt, dependencyMap);

this->notifyJSListeners(unistyleDependencies);
Expand Down
Loading