ipyreact icon indicating copy to clipboard operation
ipyreact copied to clipboard

added an example showing bidirectional binding between python/react for complex objects

Open paddymul opened this issue 2 years ago • 3 comments

bi-directional binding between jupyter and python works... as long as you replace the entire object from both sides. As is react best practice.

paddymul avatar Apr 25 '23 15:04 paddymul

and one more observation: when I change the parameter bar in the second example

z = UpdateDictFromReactWidget()
z.simple_dict["bar"] = 3000

bar does not update to 3000 as well when I press the increment bar button. bar only gets the new value after pressing the times confetti button. As before, z.simple_dict = {'foo':2, 'bar':2, 'baz':2} updates everything immediately.

kolibril13 avatar Apr 28 '23 10:04 kolibril13

Note that trailets doesn’t detect mutations of objects, only assignment. This reflect the Python language. Not something we can change I think.

On Fri, 28 Apr 2023 at 12:01, Jan-Hendrik Müller @.***> wrote:

and one more observation: when I change the parameter bar in the second example

z = UpdateDictFromReactWidget() z.simple_dict["bar"] = 3000

bar does not update to 3000 as well when I press the increment bar button. bar only gets the new value after pressing the times confetti button. As before, z.simple_dict = {'foo':2, 'bar':2, 'baz':2} updates everything immediately.

— Reply to this email directly, view it on GitHub https://github.com/widgetti/ipyreact/pull/9#issuecomment-1527308193, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANPEPL5QM443K3SS2XLYODXDOIONANCNFSM6AAAAAAXLGOXBM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Maarten Breddels Co-Founder of Widgetti https://widgetti.io/ Your partner for Jupyter- and data-apps Tel: +31 6 2464 0838 <+31+6+24640838> [image: Twitter] https://twitter.com/maartenbreddels[image: Github] https://github.com/maartenbreddels[image: LinkedIn] https://linkedin.com/in/maartenbreddels

maartenbreddels avatar Apr 28 '23 10:04 maartenbreddels

Thanks a lot for your time and for this review! Really looking forward to reading and incorporating your comments later today!

kolibril13 avatar May 03 '23 10:05 kolibril13