satya164/react-native-tab-view

jumpTo function not passed through to sceneMap

NemyaNation opened this issue · 3 comments

Current behavior

Inside one of my scenes I have the following code

console.log("this.props.jumpTo: ",this.props.jumpTo) // => undefined
this.props.jumpTo('shopping');

My scene looks like this:

  _renderScene = SceneMap({
    general: this.renderGeneral,
    shopping: this.renderShopping,
    history: this.renderHistory,
    alerts: this.renderAlerts,
  });

Current behaviour is that this.renderGeneral function (initial index) does not recieve any of the props that are stated in the documentation.

Expected behavior

Navigate from one tabView to another within the scene by using the jumpTo prop that the documentation states it passes through.

Reproduction

Simple explanation required

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Environment

package version
react-native-tab-view "^3.1.1"
react-native-pager-view "^4.2.4"
react-native "~0.63.3"
expo "^38.0.0" (detached)
node v14.2.0
npm or yarn npm

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native-pager-view (found: 4.2.4, latest: 5.4.15)
  • react-native (found: 0.63.3, latest: 0.68.1)
  • expo (found: 38.0.0, latest: 44.0.6)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

change your scene:

renderGeneral = () => {...} => to renderGeneral = (props) => {...}

then inside the scene you can use props.jumpTo('shopping'); instead (without this.)