-
-
Notifications
You must be signed in to change notification settings - Fork 927
Isiah Meadows edited this page Nov 25, 2015
·
35 revisions
Common questions found on Gitter, the Google Group, and StackExchange
Contributors: Please add links to gists instead of lengthy code examples
- Where can I find help learning Mithril?
- See the Mithril Community Page. Mithril developers are very friendly people!
- How can I add animation to my Mithril app?
- Leo wrote an article on integrating velocity.js here.
- There are community projects dealing with animation here.
- The Recipes and Snippets page has a few suggestions here
- Animated Page Flip
- CSS translate
- How do I fix this error:
"Please ensure the DOM element exists before rendering a template into it."
- Try putting the script tag for the offending javascript as the last thing inside the body tag.
- A component that has no component ancestors (see Why doesn't my component render?)
- The component view function must return a virtual element, not an array of elements:
return m("div")
return [m("div")]
- Only a top-most component may return an array:
App.view = function(){ return [ m("div"), m("div") ] }
- How do I (re)initialize all controllers in my app?
m.route( m.route() )
- How do I unmount/unload a component?
- How do I make an m.route change without scrolling the page?
- call m.route in a setTimeout with duration 0 (This is a quirk of v0.2.0)
- Why is my view redrawn on every key press?
- all on- events cause a redraw
- oninput fires at each single character change in the field
- onchange fires when the field is blurred etc. (try this)
- https://developer.mozilla.org/en-US/docs/Web/Events/change
- How do I define a catch-all route (404)?
m.route(body, '/', {
'/': home,
'/test': test,
'/:other': my404component
});
- How do I re-initialize all controllers in my app?
m.route(m.route())
- What's next for Mithril?
Check out #802 for a curated list of what is being discussed/developed for future Mithril additions.