react-sdk
react-sdk copied to clipboard
added useCallback to getCurrentDecision in useDecision hook
adding useCallback here fixed a few things:
- 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)
- Before it was redefining getCurrentDecision on every rerender of the useDecision hook, which decreased performance
This seems to relate to #196 and (now) internal ticket FSSDK-9624
@monahans, this has been added in #273 with so many other improvements. Thanks for the suggestion. Closing this!