prop()

@mvuijs/core / rx / prop

prop() #

Use to specify a coponents props.

Example #

class MyComponent extends Component {
  props = {
    value: rx.prop('hi'),
  }
  render() {
    return [
      h.input({ fields: { value: rx.bind(this.props.value) } } ),
    ];
  }
}

Signature #

prop<T>(options?: PropOptions<T>): Prop<T>;

Type parameters #

  • T

Parameters #

Name Type
options? PropOptions <T>

Returns #

Prop <T>

Defined in: packages/core/src/rx/prop.ts:14

Use to specify a coponents props.

Example #

class MyComponent extends Component {
  props = {
    value: rx.prop('hi'),
  }
  render() {
    return [
      h.input({ fields: { value: rx.bind(this.props.value) } } ),
    ];
  }
}

Signature #

prop<T>(options?: PropOptions<T> & {
    optional: true;
}): OptionalProp<T>;

Type parameters #

  • T

Parameters #

Name Type
options? PropOptions <T> & { optional: true; }

Returns #

OptionalProp <T>

Defined in: packages/core/src/rx/prop.ts:17

Use to specify a coponents props.

Example #

class MyComponent extends Component {
  props = {
    value: rx.prop('hi'),
  }
  render() {
    return [
      h.input({ fields: { value: rx.bind(this.props.value) } } ),
    ];
  }
}

Signature #

prop<T>(options?: PropOptions<T> & {
    defaultValue: T;
}): OptionalProp<T>;

Type parameters #

  • T

Parameters #

Name Type
options? PropOptions <T> & { defaultValue: T; }

Returns #

OptionalProp <T>

Defined in: packages/core/src/rx/prop.ts:20