-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ref warning when using component for the content #134
Comments
Wrapping the component in Basically change
So I guess another solution will be to do the following inside react-native-walkthrough-tooltip Declare a function like this And then replace this
with this
I can make a push addressing the issue by either method 1 that I mentioned above or with this ForwardRef method mentioned here. Please let me know if that will be helpful. |
Seems like a reasonable approach, but I have not played with react-native-web enough to be sure. |
@gregfenton I realized that this is not really specific to React Native Web actually. Also it seems like the correct way to fix this would be to do the |
I am using the library for my React-Native-Web project and when I try to use a component for the content of the toolTip, the Chrome console throws an error when the ToolTip appears for the first time. For this code
It shows an error saying
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
.Check the render method of 'TouchableWithoutFeedback'.
Hovewer if I replace the content with just
<View style={{ width: 100, height: 100, backgroundColor: '#ff0000' }} />
it works fine. I tried just remporarily replacing theTouchableWithoutFeedback
components inside the react-native-walkthrough-tooltip library withTouchableOpacity
and the error was gone.Any ideas on how we can avoid this warning currently? Should I make a push and change the
TouchableWithoutFeedback
component withTouchableOpacity
and set ActiveOpacity to 1?Thank you.
The text was updated successfully, but these errors were encountered: