arunoda / react-komposer

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

send props to errorHandler and loadingHandler #159

Open zvictor opened 7 years ago

zvictor commented 7 years ago

I have a scenario where a parent component sends a prop down to be consumed by my container. In the cases in that errorHandler is rendered, though, I also need to consume the same prop and it is not available.

The prop in question is used by the inner component to define its order value. Without the order value, the error component is totally misplaced.


Example:

<Blog>
  <Article id="1" order={3} />
  <Article id="2" order={1} />
  <Article id="3" order={2} />
</Blog>

If Article#3 fails and I cannot define order for its errorHandler, then it would be rendered on top, instead of the middle:

<div class="Blog">
  <div class="Article" id="1" style="order: 3" />
  <div class="Article" id="2" style="order: 1" />
  <div class="Article-error" /> <!-- doesn't contain `order` statement -->
                                <!-- will render on top -->
</div>
AlexanderArvidsson commented 6 years ago

Any progress on this? Would be great if this could be merged.