torayeff torayeff - 2 months ago 6x
React JSX Question

Meteor React subscription delay

I have this little snippet of code:

getSearchQuery(evt) {
let query =;

Meteor.subscribe('searchResults', query, function() {
console.log('subscription ready');

render() {
return (
hintText='Hint text'

After typing first letter in input I expect in console 'subscription ready' output, but this output appears only after typing the second letter. In other words the 'subscription ready' output delays till the next letter typing.

For example if the search string is '123', typing '123' will result in two 'subscription ready' outputs, while I am expecting for three.

Is it possible to fix this problem somehow?


I noticed you are passing onChange prop to I recommend that you use onKeyPress see: as It's pure react event, as for the subscription ready log. Make sure you made proper conditions in your publish function, instead of .length >= 2 to .length > 2.