question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Copilot w/React-navigation, any idea how wrap a const with the copilot prop?

See original GitHub issue

Actually i have this progress (?) using this library w/react-navigation, exactly createBottomTabNavigator but the problem(s) are this: 1: This method (createBottomTabNavigator ) only works exporting a const 2: I dont know how to export this const with the copilot prefix (example: export default copilot()(CustomConst) If anyone knows how i can do this thing probably save my entire project My code:

import React, {Component} from 'react'
import { Image, View, SafeAreaView, StyleSheet, Text, AsyncStorage } from 'react-native'
import HomeScreen from '../screens/home/HomeScreen'
import {createBottomTabNavigator} from 'react-navigation-tabs'
import { Icon } from 'native-base'
import StatsStack from './StatsStack';
import ScannerScreen from '../screens/scanner/ScannerScreen';
import {
  heightPercentageToDP as hp,
} from 'react-native-responsive-screen'
import { copilot, walkthroughable, CopilotStep } from 'react-native-copilot';

const WalkthroughableText = walkthroughable(Text);
const WalkthroughableImage = walkthroughable(Image);

class Null extends Component{
  render(){
    return <View/>
  }
}

const nav = createBottomTabNavigator({
  Home: {
    screen: HomeScreen,
    navigationOptions: () => ({
          tabBarIcon: ({tintColor})=> {
            return (
              <CopilotStep text="This is your home screen.  Here you can check past workouts, future workouts, and most importantly, today's suggested workout.." order={1} name="home">
                <WalkthroughableText>
                  <Icon name={'home-outline'} type='MaterialCommunityIcons' style={{color: tintColor, fontSize: hp('4.5%')}}/>
                </WalkthroughableText>
              </CopilotStep>
            )
          }
        }
    )
  },
  Scanner: {
    screen: ScannerScreen,
    navigationOptions: ( ) => ({
      header: null,
      tabBarVisible: false,
      tabBarIcon: ({tintColor})=> {
        return (
          <CopilotStep text="This is the session screen.  Here you can activate EvenLift cameras and start your workout. Check www.evenlift.io/usage for detailed instructions." order={2} name="lift">
            <WalkthroughableImage
              small source={require('../assets/images/Logos/escanear-icon.png')}
              style={{width: hp('8%'), height: hp('8%'), marginBottom: hp('3.5%')}}
            >
            </WalkthroughableImage>
          </CopilotStep>
        )
      }
    })
  },
  Stats: {
    screen: StatsStack,
    navigationOptions: () => ({
          tabBarIcon: ({tintColor})=> {
            return (
              <CopilotStep text="This is the analysis screen, showing detailed summaries of your progress so far." order={3} name="ChartInfo">
                <WalkthroughableText>
                  <Icon name={'chart-line'} type='MaterialCommunityIcons' style={{color: tintColor,fontSize: hp('4.5%')}}/>
                </WalkthroughableText>
              </CopilotStep>
            )
          }
        }
    )
  }
}, {
  tabBarOptions: {
    style: {
      backgroundColor: '#433650',
      height: hp('6.5%')
    },
    activeTintColor: '#90D16B',
    inactiveTintColor: '#312740',
    showLabel: false,
    scrollEnabled: true
  },
  initialRouteName: 'Home'
})

export default nav

// export default copilot({animated: true, stepNumberComponent: Null})(nav) Maybe something like this??

If anyone have questions about how i can divide the routes feel free to ask here in the comment box, actually if i export nav without the copilot react-native throw this errror TypeError: Cannot read property ‘getCurrrentStep’ of undefined

anyone help me pls :C

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
YisusMBcommented, Jun 21, 2019

@ahmetozalp the only way i found to solution this is create a “false” intro view that shows exactly the same as the REAL bottomTabNavigation, and when the tour was finished redirect to the real bottomTabNavigation if you need more explanation let me know

0reactions
ahmetozalpcommented, Jun 22, 2019

thank you. @YisusMB

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mohamad Mohebifar react-native-copilot Issues - Giters
Mohamad Mohebifar react-native-copilot: Step-by-step walkthrough for your ... Copilot w/React-navigation, any idea how wrap a const with the copilot prop?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found