mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Define precise return types for toJs conversions, instead of generic jsi::Value (#51224)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51224 Changelog: [Internal] We have a bunch of places where we rely on implicit conversion operators of `jsi::Value` and return some primitive type. This doesn't work well with Bridging, because currently it doesn't take into account these implicit operator conversions: primitives won't be treated as primitivies, but rather as generic `jsi::Value`, which could be many things. We should be explicit about return type in `toJs`, because it affects the type checking logic. Reviewed By: javache Differential Revision: D74478571 fbshipit-source-id: 0633159c5af3a02aafe14e2b137c133d4554a5f8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e403b510d0
commit
7430ee0b99
@@ -62,7 +62,7 @@ struct Bridging<CustomEnumInt> {
|
||||
}
|
||||
}
|
||||
|
||||
static jsi::Value toJs(jsi::Runtime& rt, CustomEnumInt value) {
|
||||
static int32_t toJs(jsi::Runtime& rt, CustomEnumInt value) {
|
||||
return bridging::toJs(rt, static_cast<int32_t>(value));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user