Looking at the compiled code it seems like this happens because the renderMessage function is called before its wrapping li, being passed to an inner function instead of being called inside it at the correct place:
It would be safer to always call functions like this inside the function wrapping it, instead of passing its return value as a param, to guarantee the order of incremental dom calls can happen as the developer expects.
Say you have some code like this:
After patching the element the rendered contents should be a list with
<li><em>
items inside it, but are actually:Looking at the compiled code it seems like this happens because the
renderMessage
function is called before its wrappingli
, being passed to an inner function instead of being called inside it at the correct place:It would be safer to always call functions like this inside the function wrapping it, instead of passing its return value as a param, to guarantee the order of incremental dom calls can happen as the developer expects.