ReactNative:RCTJSONStringify() e

2018-12-03  本文已影响0人  帅气的小时

React Native 问题汇总:


Bug:

RCTJSONStringify() encountered the following error: Invalid number value (infinite) in JSON write.

原因:原生端在与JS端产生数据交互时是否传值中数据格式出现问题。

🌰:

CGRect result = [[[touches anyObject] view] measureLayoutRelativeToAncestor:[[touches anyObject] window]];

分析:该 result 中 origin.x y 的值为 +Inf,RN解析器成 json 时报错。

上一篇 下一篇

猜你喜欢

热点阅读