Giter Site home page Giter Site logo

Comments (3)

slorber avatar slorber commented on September 27, 2024 1

This is true, and I'll fix this as soon as I have a good developer setup

Also => #3

from hooks.

slorber avatar slorber commented on September 27, 2024 1

@iamgerardm the issue to check is #40

It's not so clear how to solve this issue, I've tried to see with the React team what the reco here: facebook/react#16956

One solution is to expose a navigation ref, always stable:

const navigationRef= useNavigationRef();
useEffect(() => {
  navigationRef.setParams({ myParam: 'myValue' });
}, [navigationRef]);

I don't know if we want to ship such a public api, it feels a bit weird. In the meantime you can create useNavigationRef in userland, it seems pretty safe in most cases (according to React team, the risk is when you start to pass that ref to children comps as props)

const useNavigationRef = () => {
  const navigation = useNavigation
  const ref = useRef(navigation);
  useLayoutEffect(() => {
    ref.current = navigation;
  });
  return ref;
}; 

from hooks.

iamgerardm avatar iamgerardm commented on September 27, 2024

Any update on this?

from hooks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.