Hyperapp do not call oncreate handler when view mounted to document.body
See original GitHub issueCode:
import { h, app } from 'hyperapp';
function view() {
return (<div oncreate={() => console.log('log oncreate')} />);
}
app({}, {}, view, document.body);
In this case we do not see a message log oncreate
. It take some time to understand that app mount view to body and this element is not re-created. Maybe I miss something, but I have assumption that this handler should be called in any case when view mounted first time.
I solve a “problem” in this way: just add element with ID and mount view to it.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
hyperapp - npm
Hyperapp is a JavaScript micro-framework for building web applications. ... </div> ) app(state, actions, view, document.body). Hyperapp ...
Read more >Hyperapp V2 lifecycle method (onCreate) - Stack Overflow
1 Answer 1 · Then how are we supposed to fetch data or do any task at the creation time of any component?...
Read more >Functional Programming in JavaScript with Hyperapp - Medium
])window.main = app(state, actions, view, document.body). You can also use JSX instead of calling the h function to create elements.
Read more >hyperapp: Versions - Openbase
app" export const main = app(state, actions, view, document.body) ... If you don't call the function, the element will not be removed.
Read more >tmuxinator - OSCHINA - 中文开源技术交流社区
tmuxp, tmux session manager. built on libtmux. We need help! tmuxp is a trusted session manager for tmux. If you could lend your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jmas Absolutely, https://github.com/hyperapp/hyperapp/pull/590 is also somewhat related to this. Thanks for bringing this up!
@JorgeBucaran Thanks for explanation. Now I see. I double checked this: if I have non-empty container
oncreate
is not called. I guess this should be mentioned somewhere in docs to prevent misunderstanding.