Combo
  • Combo.js
  • Guide
    • Concepts
      • Lifecycle Methods
  • APIs
    • Component
      • canMount
      • canUnmount
      • canUpdate
      • created
      • el
      • isMounted
      • mount
      • mounting
      • mounted
      • on
      • props
      • receiving
      • received
      • refresh
      • render
      • rendered
      • state
      • unmount
      • unmounting
      • unmounted
      • update
      • updated
      • updating
  • FAQs
    • Props
    • State
    • Events
    • Ajax
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Example
  • Notes
  1. APIs
  2. Component

receiving

Invoked before the component receives props.

Parameters

  • props : object The props.

Returns

object The modified props

Example

import { Component } from "combo-js";

const Example = new class extends Component {
    receiving() {
        return {
            text: "New value"
        }
    }
    render() {
        return `
            ${this.props.text}
        `;
}();

Example.mount(document.getElementById("root"), {
    text: "Passed value"
});
<div id="root"></div>

Notes

Used to safely manipulate props before the component is mounted.

PreviouspropsNextreceived

Last updated 6 years ago