Comments (4)
Ah this might be something to do with the interaction between async components and reactive context. The error message seems to point out that there is no current_node
set in Root
when we are inside an async scope. I'll have to look more into this.
from sycamore.
The problem seems to be the Rc wrapper, once I move use_context
out of it, it works
from sycamore.
Oh I just realised are you calling login
in an event handler? If that's the case, this would be expected behaviour. Event handlers are called at the root scope where the context is not defined, thereby causing the error. The way to solve this would be to hoist the use_context
out of the event handler.
from sycamore.
Thanks for clarifying this!
In the 0.8.2 version, I used a global state struct that had many methods that needed a handle on the state struct itself, and since context was available everywhere, I pulled in the state via use_context
. But since actions where called by an event handler, I got this error all over the place when updating to 0.9.0-beta.2. Using use_context
only in components and passing the state around solved it finally.
from sycamore.
Related Issues (20)
- Optional attributes in view!
- Abstract over reactiveness HOT 1
- SVG with interpolation doesn't render in browser HOT 2
- Probable bug in signal propagation HOT 4
- Panic updating signal in 0.9.0-beta.2
- Bootstrap scrollspy support HOT 4
- Book (website) routing not properly updating HOT 8
- Shared data update failed when nested routing layout HOT 1
- Is there a tool for converting HTML to sycamore components? HOT 1
- Is there a case of a right-click pop-up menu? HOT 2
- Nested component using string error HOT 1
- Nested component click event error HOT 1
- Nested component click event error HOT 1
- Hydrate example has a javascript error and does not work HOT 2
- Support binding to a radio input value HOT 2
- Console error "closure invoked recursively or after being dropped" when executing `navigate` in a component using `Indexed` HOT 3
- hydration start marker not found after trunk build --release
- Websocket example HOT 1
- Unable to view source in the docs: `Query parser error: "Unexpected `.`"` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sycamore.