Skip to content
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

Support connecting external navigation for screen with undefined navigation parameters #779

Open
Charles-Johnson opened this issue Jan 5, 2024 · 2 comments
Assignees

Comments

@Charles-Johnson
Copy link
Contributor

I tried using Hyperview in an existing app using 'react-navigation' for a screen without any navigation parameters passed to it e.g.

function Screen({navigation, route}) {
  
  return <Hyperview
    navigation={navigation}
    route={route}
    push={(params) => {
      // parse params and call navigation.push
    }}
    back={navigation.goBack}
   navigate={(params) => {
    // parse params and call navigation.navigate
   }}
   // other props
  />;
}

In this case, route.params === undefined which hyperview doesn't seem to handle. I forked the library and fixed the issue in these commits:

Perhaps stricter type checking is needed in https://github.com/Instawork/hyperview/tree/master/src/core/components/hv-screen to avoid these kinds of issues?

What would be the best way to contribute back?

@adamstep
Copy link
Contributor

adamstep commented Jan 5, 2024

Thanks for reporting @Charles-Johnson . We have developed a new way to define navigation hierarchy in HXML itself, this is a new feature that isn't well documented yet. Perhaps @hgray-instawork can chime in since he worked on it. We welcome contributions but I want to make sure the work would be relevant given we are rolling out the new system soon!

@hgray-instawork
Copy link
Collaborator

Thanks very much for your contribution @Charles-Johnson. I'll have a look at the proposed changes and compare them to what we have in our new implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants