arunoda / react-komposer

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

Errors thrown within child components are not bubbling up #143

Open dbishoponline opened 7 years ago

dbishoponline commented 7 years ago

Question:

If I compose an App component like this compose(composeFunc)(App). Then, inside the App component there is a <Header />. Inside the Header, there is a <Logo /> component. The Logo component is a dumb component:

import React, {Component} from 'react'

const Logo = ({ name }) => (
    <span>{name}</span>
)

export default Logo

That all works, but say I change the 'name' prop to.. 'names' (which should throw an error)...all that happens is the default "Loading..." displays but no error is logged to the console. Below is the code, with the change, that should throw an error:

import React, {Component} from 'react'

const Logo = ({ name }) => (
    <span>{names}</span>
)

export default Logo

When <App /> is NOT composed , the error from Logo displays correctly in the console.

Logo.jsx:3 Uncaught ReferenceError: names is not defined

Any ideas why the error is not getting logged or bubbled up to the composer?

Thanks :)

arunoda commented 7 years ago

Better if you can send me a sample app, where I can see try this locally.