Warning!Hence the component extends from React Component, do not use any of its API. It may be removed in the future and using it may cause incompatibility with Wazapp components!
props
props
exactly like in React Component returns an Object of passed properties to the component. They are automatically tracked by Wazapp.isUnmounting
willUnmount
is called.isUnmounted
willUnmount
is called.template(props: P, context: this): ReactNode | void
template(props)
allows you to define your component template written in JSX. Remember that you are still working in React so things like className
instead of class
are still required.ReactNode
or nothing. By default if not defined it will yield()
component's children
.yield(...args)
yield()
allows you to return component's children
or in case the children
is a function, it will allow you to call it with custom arguments....args
: any[]
- your custom arguments that will be used on children
call (if children
is a function)didMount()
didMount
is invoked immediately after a component is mounted (inserted into the tree). Initialization that requires DOM nodes should go here.willUnmount()
.didUpdate(prevProps)
didUpdate
is invoked immediately after updating occurs. This method is not called for the initial render.prevProps
: T<ComponentProps>
- previous component propertieswillUnmount()
willUnmount
is invoked immediately before a component is unmounted and destroyed. Perform any necessary cleanup in this method, such as invalidating timers, canceling network requests, or cleaning up any subscriptions that were created in didMount()
.