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

Trying to setup react-intercom #21

Closed
dzeno opened this issue Oct 24, 2016 · 4 comments
Closed

Trying to setup react-intercom #21

dzeno opened this issue Oct 24, 2016 · 4 comments

Comments

@dzeno
Copy link

dzeno commented Oct 24, 2016

I get this error: Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

I import react-intercom as import { Intercom } from 'react-intercom';.

UPDATE
It works now, but I had to set it up 'manually' first. Meaning, I had to make sure my app is connected to Intercom, then I could use react-intercom. I followed this gist and I managed to connect app with Intercom. After that react-intercom seems to be working.

But it somehow doesn't make sense that I had to do this first, right?

@jeremy-dorfschmidt
Copy link

import Intercom from 'react-intercom' should solve this issue. I initially had { } around Intercom and had the same error.

@nhagen
Copy link
Owner

nhagen commented Dec 6, 2016

I was able to set this up just now in a new application without any special configuration--in the setup process, they automatically moved me to the next phase when I refreshed my page after inserting the component.

Any additional context you can share that could reproduce this? Unfortunately it is kind of annoying to create new Intercom instances just to test this.

Anyways, marking as resolved.

@nhagen nhagen closed this as completed Dec 6, 2016
@jeremy-dorfschmidt
Copy link

@nhagen Just following up on this, so we shouldn't have to import Intercom from 'react-intercom'? A question around that is, then how does React know anything about the <Intercom .... /> component? I have react-intercom installed (package.json), however wiring the component just as per the instructions on the front page, no import in component, no script import. I have in my app <Intercom appID="my app id" {...user}/> when I do this I get the following issue warning/errors.Warning: i(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object. a.(anonymous function) invariant.js:44 Uncaught Error: i(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.

@nhagen
Copy link
Owner

nhagen commented Jan 17, 2017

Sorry, I'll add the import to the README to make it more clear. I am able to get past the verification step by simply importing the component as normal and use it in an application.

Can you provide an example of your code? That would help me understand if there's a specific way you're doing this that I haven't considered which doesn't work.

Edit: after updating the readme, I realize it wasn't apparent that the export you needed was the default export rather than a named export--if you're doing import { Intercom } from 'react-intercom', Intercom will be undefined, possibly causing that error you're getting. It should be import Intercom from 'react-intercom'

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

3 participants