Renders its children based on a condition. For the condition to be reactive it needs to be function
name | type | description |
---|
when | any | once when becomes truthy, it will show its children |
fallback? | any | a thing to render as fallback when the condition is falsy |
Test using static values
Test using a signal and also the signal value
How many times a children renders by a toggling signal
Using the children helper we can avoid re rendering
A fallback renders a component when the condition becomes false
Tests a signal for a fallback.
Using the value from the condition in a callback
Children are arrays, so the callbacks could be anywhere
Test what happens when a value for a callback becomes null
In between 2 elements and in between 2 text nodes