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
React.createElement: type is invalid #150
Comments
Hi, Typically something you are importing is undefined. Did you figure this out? You shouldn't need to add this to a vendor option if you're referring to build tools like webpack, just the import should do. If below the import you do |
Hello, I was getting a similar error when importing with Using |
Hm strange, are you guys using webpack/babel in your projects or something else? |
Closing due to inactivity |
I am seeing the same thing. Though How can I help debug? |
using a very specific version 5.0.0 worked for me. |
@sujayjaju You shouldn't do @ssxv How are you importing the component? |
I m doing as suggested by above comments |
@ssxv in v6 do |
@dominictobias Yes, I am using console log for ReactCrop return |
So I tried deleting node_modules and doing a fresh install.
@dominictobias Does that provide a clue? |
It seems like your build tool is picking up the |
For now try |
@sujayjaju please try 6.0.1 |
@dominictobias |
Hi guys, I have the same problem here, I am using ts in my project, after some research, I find that I have to do something like this to make it work: |
Hi Max, what version are you using?
…On Thu, 1 Nov 2018 at 03:46, Max ***@***.***> wrote:
Hi guys, I have the same problem here, I am using ts in my project, after
some research, I find that I have to do something like this to make it work:
import * as ReactCrop from 'react-image-crop'; render() { const Component
= (ReactCrop as any).default; return ( <Component src={src} ... /> ) }
It seems like something is wrong in the definition file.
help this helps.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#150 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAuZ-rCfZWsFtVQk5OyFEqdVmAMfXhy5ks5uqm6UgaJpZM4RUSXM>
.
|
Hi @dominictobias , I am using 6.0.4. |
Hi! Thank you for creating this plugin!
I'm currently trying to implement it in my project, but I keep getting the following error:
warning.js:33 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of
AddEditLinkModal.
Perhaps I'm implementing it the wrong way?
I'm using webpack for my assets. I've put "react-image-crop" inside my "vendor" entry.
Inside my react component I've done the following import:
import ReactCrop from "react-image-crop";
And the logic I created:
Inside my render I'm rendering the following ReactCrop:
<ReactCrop crop={this.state.crop} src={imgPreview} onChange={this.onCropImageChange} />
The imgPreview is the reader.result which is saved to my redux store.
The text was updated successfully, but these errors were encountered: