Skip to content

Commit 2fed660

Browse files
committed
adding toString and fromRawValue conversion to view/accessibilityPropsConversions
1 parent 3357873 commit 2fed660

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,26 @@ inline void fromRawValue(
174174
const PropsParserContext &context,
175175
const RawValue &value,
176176
AccessibilityUnit &result) {
177-
auto map = (butter::map<std::string, RawValue>)value;
178-
/*
177+
// don't use std::string instead use RawValue and add a toString conversion
178+
auto map = (butter::map<std::string, std::string>)value;
179179
auto hours = map.find("hours");
180180
if (hours != map.end()) {
181181
// This probably calls toString()
182-
fromRawValue(context, hours->second, result.hours);
182+
result.hours = hours->second;
183183
}
184-
*/
184+
/*
185185
if (value.hasType<std::string>()) {
186-
auto string = "10";
186+
auto string = toString(value);
187187
result.hours = string;
188188
} else {
189189
LOG(ERROR) << "Can not set type string for AccessibilityUnit field hours";
190190
}
191+
*/
192+
}
193+
194+
inline std::string toString(
195+
const AccessibilityUnit &accessibilityUnit) {
196+
return "default string";
191197
}
192198

193199
inline std::string toString(

0 commit comments

Comments
 (0)