Props
Name | Type | Default | Description |
---|
See also Nothing
import { Just } from 'flowr';
Just
has no special behaviour, it just renders it's children without any changes. Just
is useful when you need to dynamically create a controlled render.
// ...
render() {
// If we have a predicate defined, we want to render the `span`
// only when that predicate is true. If not, just render it.
const Wrapper = this.props.predicate ? Maybe : Just
return (
// Just will ignore the props
Hello, world!
)
}
The above snippet is just for the sake of example. You would achieve the same outcome by using just a Maybe
:
// ...
Hello, world!
Name | Type | Default | Description |
---|
See also Nothing
Contribute on Github! Edit this section.