bitovi / ylem

Add Observable View-Models to React components
https://bitovi.github.io/ylem/
MIT License
42 stars 2 forks source link

Ylem not passing props into another ylem compoennt #190

Open BigAB opened 6 years ago

BigAB commented 6 years ago

Here is a weird bug: https://codesandbox.io/s/wwwzqrqr7k

If you un-comment the mapProps() bit, which should essentially be a no-op, it starts working as expected.

So... that's kind of weird.

christopherjbaker commented 6 years ago

I bet it has to do with how the actual prop is not the object that is returned when you request props. If one were to check the values of the props passed into the second connect component, i bet they would be the { _observable: ... } object, instead of the observable itself.

If this is deemed needing to be fixed, it might be as simple as detecting this special key and using its value instead of the whole props object inside updateObservableWithProps.