Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined import #25

Open
micheledisalvatore opened this issue Nov 7, 2018 · 1 comment
Open

undefined import #25

micheledisalvatore opened this issue Nov 7, 2018 · 1 comment

Comments

@micheledisalvatore
Copy link

I'm working on a typescript react project where I've installed react-focus-trap via yarn yarn add react-focus-trap and I can see into the package.json "react-focus-trap": "^2.7.1",.

In my code I'm using it:

// ...
import FocusTrap from 'react-focus-trap';
// ...

class Modal extends React.Component<ModalProps, any> {
	// ...

	render() {
		return <FocusTrap className='modal'><div /></FocusTrap>
	}
}

Debugging it, I can see that FocusTrap is undefined and react is generating this error:

warning.js?85a7:33 Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of `Modal`.

Any idea on this error?

@nhunzaker
Copy link
Contributor

Huh. I'll take a look. It's possible that I got something wrong. We're consuming this module on ars-arsenal, another project of ours without an issue. It'd be great to know if our configuration isn't correct.

I can take a look later this week :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants