I am using ustated library in my project.
In render method, I am using set like this:
render() {
    return (
            <ApiSubscribe>
                {api => (
                    <button content='CLICK ME' onClick={() => api.setMessage('RENDER CLICK')} />
                )}
            </ApiSubscribe>
    )
}
How can I call api.setMessage OUTSIDE of render? For example in componentDidMount ?
ApiSubscribe is:
export const ApiSubscribe = props => {
    // We also leave the subscribe "to" flexible, so you can have full
    // control over your subscripton from outside of the module
    return <Subscribe to={props.to || [Api]}>{props.children}</Subscribe>;
};
 
                        
Like this?