tidee
1
I have this container and I would like to be able to wait for the subscription - how can I do this?
export default createContainer(({ params }) => {
const dataHandle = Meteor.subscribe('lists');
const dataIsReady = dataHandle.ready();
return {
dataIsReady,
data: dataIsReady ? Lists.find() : []
};
}, ListTable);
1 Like
in your ListTable component, wrap the component in
if (this.props.dataIsReady) {}
2 Likes
tidee
3
Like this?
render() {
return (
if (this.props.dataIsReady) {
<div className="table-format-1">
<table id="listTable">
</table>
</div>
}
);
}
const renderComponent = this.props.dataIsReady ? (
<div className="table-format-1">
<table id="listTable"></table>
</div>
) : "";
render() {
return {renderComponent}
}
1 Like