DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
18.49k stars 703 forks source link

nonreactive examples for hooks were not compilable as written #2337

Open rogusdev opened 2 weeks ago

rogusdev commented 2 weeks ago

My code was out of date, so I missed https://github.com/DioxusLabs/dioxus/commit/b6d3da2b31c336fdf38845a790969edda9f8e0e7 -- but I still caught one more, and added an example. Also tweaked the comments.

rogusdev commented 2 weeks ago

Notably: for the example, I did not call &*res.read_unchecked() as the docs suggest on https://dioxuslabs.com/learn/0.5/reference/use_resource -- instead choosing to simply do res(), which definitely works. If the longer syntax is preferred / recommended, I would like to update my example to keep best practices in all places, but I'd also like to hear why, thanks.