react-sdk icon indicating copy to clipboard operation
react-sdk copied to clipboard

added useCallback to getCurrentDecision in useDecision hook

Open monahans opened this issue 3 years ago • 1 comments

adding useCallback here fixed a few things:

  1. Bug: if you used multiple useDecision hooks with { autoUpdate: true }, the second one would not autoUpdate (you had to fully reload the app to get the decision to update)
  2. Before it was redefining getCurrentDecision on every rerender of the useDecision hook, which decreased performance

monahans avatar Oct 05 '22 20:10 monahans

This seems to relate to #196 and (now) internal ticket FSSDK-9624

mikechu-optimizely avatar Aug 28 '23 19:08 mikechu-optimizely

@monahans, this has been added in #273 with so many other improvements. Thanks for the suggestion. Closing this!

junaed-optimizely avatar Aug 15 '24 17:08 junaed-optimizely