Closed arlovip closed 3 months ago
I also encountered this problem. I tried switching versions to find the problematic version and found that versions "5.1.3" and "5.2.0-rc.2" were normal; Version 5.2.1 is problematic. Further investigation revealed that this warning prompt only appears when the "form" component is used.
I fixed it to add ref
to InnerNoticeBar
in notice-bar.js
file.
// Add ref here.
function InnerNoticeBar(props, ref) {
....
return _react["default"].createElement(_reactNative.TouchableWithoutFeedback, { onPress: onPress }, childNode);
}
var NoticeBar = (0, _react.forwardRef)(InnerNoticeBar);
exports.NoticeBar = NoticeBar;
I fixed it to add
ref
toInnerNoticeBar
innotice-bar.js
file.// Add ref here. function InnerNoticeBar(props, ref) { .... return _react["default"].createElement(_reactNative.TouchableWithoutFeedback, { onPress: onPress }, childNode); } var NoticeBar = (0, _react.forwardRef)(InnerNoticeBar); exports.NoticeBar = NoticeBar;
How do I operate? I try it like this,but failed
@Jhh910 You seem to miss some code snippets as can be seen above. What you need to do is to search function InnerNoticeBar(props)
and add ref
after props
like function InnerNoticeBar(props, ref)
. No futher steps are required.
@Jhh910 You seem to miss some code snippets as can be seen above. What you need to do is to search
function InnerNoticeBar(props)
and addref
afterprops
likefunction InnerNoticeBar(props, ref)
. No futher steps are required. only add ",ref" ? also failed
npx react-native info warn Package react-native-amap3d contains invalid configuration: "dependency.platforms.ios.project" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this. info Fetching system and libraries information... System: OS: Windows 10 10.0.22621 CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12500H Memory: 875.18 MB / 15.73 GB Binaries: Node: version: 20.15.1 path: D:\nodejs\node.EXE Yarn: version: 1.22.22 path: ~\AppData\Roaming\npm\node_modules\yarn\bin\yarn.CMD npm: version: 10.7.0 path: D:\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio:
@Jhh910 Yes. Only add ref
to InnerNoticeBar
. I created a new project again, installed it and modified function InnerNoticeBar(props, ref) {
. It also works well. So maybe you lost something else. Please check you logic. For example, check the logs warnings on your device or simulator?
So maybe you lost something else
thank you for your answer,but i cannot modified other except function InnerNoticeBar(props, ref)
i dont know how to check the ant-design,At present, there is no impact on operation,There's only one warning or error
i try it again today,it is succefful Yesterday was weird. thank you very much again
💬 Before You Start
🙋 Description/Step to reproduce
🔴 Version
10.7.0
💻 Environment
Android
⚫️ Output of
npx react-native info
Additional comments