3

Does anyone have an idea what could be causing the following error?

ReactCompositeComponent.js:321 Uncaught TypeError: Failed to construct 'Notification': Please use the 'new' operator, this DOM object constructor cannot be called as a function.

I'm basically recreating the react todoApp for React/Redux as a starting point. The Notification component is as follows:

import React, { PropTypes } from 'react'

const Notification = ({ myProp }) => (
  <li>
    --My Notification HTML--
  </li>
)

Notification.propTypes = {
  myProp: PropTypes.string.isRequired,
}

export default Notification

I've NEVER run into this issue in a react/redux app before and I'm absolutely clueless as to where to start looking for the source of the error. If it helps, I started with this scaffolding, though I've removed the router. I just need potential causes, though it's even better if you can identify the exact problem. If you need more information, I can provide it. Thanks!

1 Answer 1

1

Silly me. I forgot to import the Notification's component inside the component that renders it. Always after I post the question and spend a half hour tracking down the problem. :P

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.