flowr

  • Docs
  • Examples
Docs Menu
  • Getting started
  • Conditionals
    • Maybe
    • Either
    • Flip
    • Reverse
    • Order
    • One
    • Some
    • Constant
    • Just
    • Nothing
    • Pure
  • Schedulers
    • Await
    • Stream
    • Delay
    • Debounce
    • Throttle

Constant

import { Constant } from 'flowr';

Constant will render it's children only once, with their initial state, effectively preventing any updates.

// ...
state = { count: 0 }

increment = () => {
  this.setState(({count}) => ({
    count: count + 1
  }))
}

render() {
  return (
    
{this.state.count}
) } // Constant's children will never be updated // Will render:
0

Props

NameTypeDefaultDescription

Contribute on Github! Edit this section.