Closed RafaelVidaurre closed 8 years ago
Well, apparently passing null
as onData
's second argument causes the loading...
component to show again
Same problem here, I want to show the loading component again:
const onPropsChange = (props, onData) => {
Meteor.call('ordersByDateRange', props.minDate, props.maxDate, props.value, function (error, result) {
const data = result;
onData(null, { data });
});
};
export default composeWithTracker(onPropsChange)(GetOrders);
I tried to pass null
as onData
's second argument but no success:
const onPropsChange = (props, onData) => {
Meteor.call('ordersByDateRange', props.minDate, props.maxDate, props.value, function (error, result) {
const data = result;
onData({ data }, null);
});
};
Any idea?
I'm not sure but have you tried like this?
const onPropsChange = (props, onData) => {
onData();
Meteor.call('ordersByDateRange', props.minDate, props.maxDate, props.value, function (error, result) {
const data = result;
onData(null { data });
});
};
Many thanks @RevelsGit ! It works like a charm ;)
After
onData
is called with data, the loading componen is (of course) not rendered anymore.Is there a way to force that component to show again? I'm building a component which specifically requires to show the
loading...
component again after props change.