mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Remove const qualifier from all fields of ViewProps and Props
Summary: This is a part of migration staterted in D19390813. There is no need to have those as `const`. The whole `*Props` object is usually `const` (and when it's not, props should not be too). Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D19583582 fbshipit-source-id: 9c680268f944cdf08669fce7e997b05f23a02667
This commit is contained in:
committed by
Facebook Github Bot
parent
e6288dab05
commit
5b2ea6ec6a
@@ -34,33 +34,33 @@ class ViewProps : public Props,
|
||||
#pragma mark - Props
|
||||
|
||||
// Color
|
||||
Float const opacity{1.0};
|
||||
SharedColor const foregroundColor{};
|
||||
SharedColor const backgroundColor{};
|
||||
Float opacity{1.0};
|
||||
SharedColor foregroundColor{};
|
||||
SharedColor backgroundColor{};
|
||||
|
||||
// Borders
|
||||
CascadedBorderRadii const borderRadii{};
|
||||
CascadedBorderColors const borderColors{};
|
||||
CascadedBorderStyles const borderStyles{};
|
||||
CascadedBorderRadii borderRadii{};
|
||||
CascadedBorderColors borderColors{};
|
||||
CascadedBorderStyles borderStyles{};
|
||||
|
||||
// Shadow
|
||||
SharedColor const shadowColor{};
|
||||
Size const shadowOffset{};
|
||||
Float const shadowOpacity{};
|
||||
Float const shadowRadius{};
|
||||
SharedColor shadowColor{};
|
||||
Size shadowOffset{};
|
||||
Float shadowOpacity{};
|
||||
Float shadowRadius{};
|
||||
|
||||
// Transform
|
||||
Transform transform{};
|
||||
BackfaceVisibility const backfaceVisibility{};
|
||||
bool const shouldRasterize{};
|
||||
int const zIndex{};
|
||||
BackfaceVisibility backfaceVisibility{};
|
||||
bool shouldRasterize{};
|
||||
int zIndex{};
|
||||
|
||||
// Events
|
||||
PointerEventsMode const pointerEvents{};
|
||||
EdgeInsets const hitSlop{};
|
||||
bool const onLayout{};
|
||||
PointerEventsMode pointerEvents{};
|
||||
EdgeInsets hitSlop{};
|
||||
bool onLayout{};
|
||||
|
||||
bool const collapsable{true};
|
||||
bool collapsable{true};
|
||||
|
||||
#pragma mark - Convenience Methods
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class Props : public virtual Sealable, public virtual DebugStringConvertible {
|
||||
Props(Props const &sourceProps, RawProps const &rawProps);
|
||||
virtual ~Props() = default;
|
||||
|
||||
std::string const nativeId;
|
||||
std::string nativeId;
|
||||
|
||||
/*
|
||||
* Special value that represents generation number of `Props` object, which
|
||||
|
||||
@@ -33,8 +33,8 @@ TEST(ElementTest, testNormalCases) {
|
||||
auto shadowNodeAB = std::shared_ptr<ViewShadowNode const>{};
|
||||
auto shadowNodeABA = std::shared_ptr<ViewShadowNode const>{};
|
||||
|
||||
auto propsAA = std::make_shared<ViewProps const>();
|
||||
const_cast<std::string &>(propsAA->nativeId) = "node AA";
|
||||
auto propsAA = std::make_shared<ViewProps>();
|
||||
propsAA->nativeId = "node AA";
|
||||
|
||||
// clang-format off
|
||||
auto element =
|
||||
@@ -42,9 +42,9 @@ TEST(ElementTest, testNormalCases) {
|
||||
.reference(shadowNodeA)
|
||||
.tag(1)
|
||||
.props([]() {
|
||||
auto props = std::make_shared<ViewProps const>();
|
||||
const_cast<int &>(props->zIndex) = 42;
|
||||
const_cast<std::string &>(props->nativeId) = "node A";
|
||||
auto props = std::make_shared<ViewProps>();
|
||||
props->zIndex = 42;
|
||||
props->nativeId = "node A";
|
||||
return props;
|
||||
})
|
||||
.finalize([](ViewShadowNode &shadowNode){
|
||||
@@ -59,8 +59,8 @@ TEST(ElementTest, testNormalCases) {
|
||||
.reference(shadowNodeAB)
|
||||
.tag(3)
|
||||
.props([]() {
|
||||
auto props = std::make_shared<ViewProps const>();
|
||||
const_cast<std::string &>(props->nativeId) = "node AB";
|
||||
auto props = std::make_shared<ViewProps>();
|
||||
props->nativeId = "node AB";
|
||||
return props;
|
||||
})
|
||||
.children({
|
||||
@@ -68,8 +68,8 @@ TEST(ElementTest, testNormalCases) {
|
||||
.reference(shadowNodeABA)
|
||||
.tag(4)
|
||||
.props([]() {
|
||||
auto props = std::make_shared<ViewProps const>();
|
||||
const_cast<std::string &>(props->nativeId) = "node ABA";
|
||||
auto props = std::make_shared<ViewProps>();
|
||||
props->nativeId = "node ABA";
|
||||
return props;
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user