What if a certain element gets changed when the component that generates it changes, but the oncreate callback does not get called?
See original GitHub issueSay:
var Component = function () {
return <div oncreate={
function () { /* do something that never gets called? */ }
}>Some text</div>;
};
app({
root: document.body,
view: function (state, actions) {
return state.condition ? <div class="clickable" onclick={actions.change} /> : <Component />;
},
state: {
condition: true
},
actions: {
change: function () {
return {
condition: false
};
}
}
});
Would the oncreate
callback ever get called?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
The activity lifecycle | Android Developers
The Activity class provides a number of callbacks that allow the activity to know that a state has changed: that the system is...
Read more >Activity lifecycle - onCreate called on every re-orientation
Yes, activity's onCreate() is called everytime when the orientation changes but you can avoid the re-creation of Activity by adding configChanges attribute ......
Read more >Callbacks — NUKE Python Developer's Guide v10.5v1 ...
Hidden knobs include onCreate, onDestroy, knobChanged, updateUI, and autolabel. If there are many callbacks registered, code attached to knobs is always called ......
Read more >Lifecycle methods - Mithril.js
Lifecycle methods are only called as a side effect of a m.render() call. They are not called if the DOM is modified outside...
Read more >Realtime Database triggers | Cloud Functions for Firebase
You can make Firebase Realtime Database changes via the DataSnapshot or via the ... If you do not specify an instance, the function...
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
I am not sure if this is exact answer you were looking for, but whatever your application’s root element may be, you can always do this:
And you can always return arrays from components.
@infinnie Do you want to give it a shot?