react-native-app-tour icon indicating copy to clipboard operation
react-native-app-tour copied to clipboard

Question : does this library only work for buttons ?

Open Boubaker93 opened this issue 6 years ago • 20 comments

As the title said, does AppTourView.foronly works with Buttons. because i tried it with a View and a Text component and it gives me this error : Tour view does not have React Internal Fiber .

Thanks for your help

Boubaker93 avatar Mar 28 '19 14:03 Boubaker93

Thanks @Boubaker93 for raising the query.

It works for all type of views. Are you facing this problem for Android?

Thanks </ Pranav >

prscX avatar Mar 28 '19 16:03 prscX

Hello @prscX thanks for your quick response,

Yes i'm facing this problem on android (did not try it on iOS)

My react-native version is 0.58.6 My test device is using android 6.0 The app-tour version i used is 0.0.18

Thanks

Boubaker93 avatar Mar 28 '19 16:03 Boubaker93

Hi: Please refer issues section of README for the fix. Let me know in case it didn't worked out.

Thanks </ Pranav >

prscX avatar Mar 29 '19 01:03 prscX

Hello @prscX I tried the collapsable:false in my view like in this exemple :

<View
        key='Top Left'
        collapasable={false}
        ref={ref => {
            if (!ref) return
            const props = {
                order: 11,
                title: 'This is a target button 2',
                description: 'We have the best targets, believe me',
                backgroundPromptColor: '#3f52ae',
                outerCircleColor: '#f24481',
                targetRadius: 100
            }
            if (addAppTourTarget) {
                addAppTourTarget(AppTourView.for(ref, { ...props }))
            }·
        }}>
        <Text style={style}>some text</Text>
 </View>

and it sill gives me the same error (for this peace of code AppTourView.for(ref, { ...props }) )

Error: Error: Tour view does not have React Internal Fiber

Note that if i change the View with a Button component it works properly

EDIT: It also worked with TouchableOpacity and TouchableHighlight

Thanks for your help

Boubaker93 avatar Mar 29 '19 10:03 Boubaker93

I'm having the same issue on both iOS and Android - tried 0.0.18 and 0.0.17 @Boubaker93 have you managed to make it work with views?

ljuborados avatar Mar 29 '19 13:03 ljuborados

I'm having the same issue on both iOS and Android - tried 0.0.18 and 0.0.17 @Boubaker93 have you managed to make it work with views?*

@ljuborados no still did not found a solution :/

Boubaker93 avatar Mar 30 '19 11:03 Boubaker93

Hello @prscX is there any updates about this issue ?

Boubaker93 avatar Apr 04 '19 11:04 Boubaker93

I am still facing the same issue on android if i used it on a view it only make a small circle on it not on all the view but on IOS it's okay

temraz avatar Jun 11 '19 09:06 temraz

The same Issue is repeated. Working on OS platform android temporarily, and it's not working appropriately. Also, the focus is not on the whole view it renders a small circle with some ripple effects. How can I extend it to the whole view?

RishavKumar-3796 avatar Aug 09 '19 07:08 RishavKumar-3796

Does anyone find a way to used it on anything than buttons ?

danieljgp2 avatar Aug 26 '19 00:08 danieljgp2

@danieljgp2 No you cant directly use it on anything other than buttons. But i found a work around : You can just wrap your element into a touchableOpacity and set the disabled key to true like in this exemple :

<TouchableOpacity
    disabled
    key='exemple'
    ref={ref => {
         ...
      }} >
      <Text>some text to target</Text>
</TouchableOpacity >

Boubaker93 avatar Aug 26 '19 09:08 Boubaker93

@Boubaker93 Do you know if there is a way to add custom buttons inside the tours circles?

danieljgp2 avatar Aug 26 '19 14:08 danieljgp2

@danieljgp2 i don't know, i did not try that out honestly.

Boubaker93 avatar Aug 26 '19 14:08 Boubaker93

@Boubaker93 Hello, im having a problem on Android, when i set targetTransparent to False the content of the touchableOpacity goest to the back and the target overlays it.

danieljgp2 avatar Aug 30 '19 18:08 danieljgp2

@temraz @RishavKumar-3796 Im facing the same issue on android, you guys can check it here https://github.com/prscX/react-native-app-tour/issues/78 anyone found a solution to this issue ?

danieljgp2 avatar Sep 02 '19 22:09 danieljgp2

For anyone have faced with this issue.

  • please change connect react redux to
// connect(mapStateToProps, mapDispatch)(YourComponent)
connect(mapStateToProps, mapDispatch, null, { forwardRef: true })(YourComponent);

this will fix the issue "React Internal Fiber not found" for ref.

ntcong91 avatar Dec 31 '19 06:12 ntcong91

I think this issue should be closed @prscX

ntcong91 avatar Jan 18 '20 03:01 ntcong91

@ntcong91 your proposition did'nt work for me. (RN:0.61, react:16.9.0 , APTOUR:1.0.3)

Doha26 avatar Feb 10 '20 12:02 Doha26

For anyone who is still facing this issue on React Native 0.60+ (when they switched to use forwardRef on basic components like View and TouchableOpacity, etc.), here's my dirty workaround:

Create a placeholder View which extends React.Component (or PureComponent depends on your use) like this:

import React, { Component } from 'react';
import { View } from 'react-native';

export default class DefaultView extends Component
{
    render()
    {
        return(
            <View {...this.props}>
                {this.props.children}
            </View>
        );
    }
}

and wrap your app tour target inside it like this example and it will work:

Screen Shot 2020-04-14 at 23 45 35

I found out about this when I was using the library perfectly fine with TouchableOpacity on RN 0.59.10, then I upgraded my project to RN 0.62 a few days ago and the library stopped working.

phatlaunchdeck avatar Apr 14 '20 16:04 phatlaunchdeck

@phatlaunchdeck This does not work with addAppTourTarget(AppTourView.for(ref, { ...props })). Do you have any idea how it can be done? And can you give the full example with DefaultView in action ?

igachmov avatar Apr 29 '20 10:04 igachmov