arunoda / react-komposer

Feed data into React components by composing containers.
MIT License
733 stars 70 forks source link

Composer rendering container twice #163

Open derdrdirk opened 7 years ago

derdrdirk commented 7 years ago

I packed the container into a composer. The composer is subscribing to data, as soon as the subscription is ready the composer gets called again and sends the data via onData(null, props) to the container. When the container is mounted the composer runs again and triggers an update of the component.

What is triggering the reload of the composer? I am not changing any props of the composer?

P.S. I am using Meteor.

crapthings commented 7 years ago

do u have subscribe inside your container ? if so you should wait for ready

crapthings commented 6 years ago

subscribe ready is reactive source it will be switching between false to true and if your props are from collection cursor it will reactive while ddp sends message

you have to wait subscribe ready most time

because ddp message from publish cursor sends one by one

or use this.added changed removed erc to customize your ddp manually