Comments (7)
I had the same issue. I just used
import Linkify from 'react-linkify';
instead of
var Linkify = require('react-linkify');
and now it works!
from react-linkify.
@cebrakadabra what was the exact issue with the code that you solved?
The current release should work fine when using ES6 imports:
import Linkify from 'react-linkify'
Or with CommonJS:
var Linkify = require('react-linkify').default;
That behavior is caused by Babel 6 upgrade in commit 6ead6fe which changes the way how export default
works
@tasti the usage example in README is currently broken
from react-linkify.
Is there a fix or explanation for this one? I've had to use a different module as getting the same error.
from react-linkify.
yea same problem..
from react-linkify.
Yo!
I just did a PR for this.
i recoded the component to make it working in higher react versions.
I just imported that file via, to test it:
import Linkify from 'Linkify.jsx';
https://github.com/tasti/react-linkify/pull/35/files
from react-linkify.
@maksis i restructured the whole Linkify component itself to make an element out of it. Because you aren't accessing any functions from outside and you are not reliable on the state of this one, so I thought it's probably easier doing it that way.
i got the same error as reported from other people here:
React.createElement: type is invalid -- expected a string (for built-in components)
So, I used that as a motivation to make an Element out of it while debugging the error, which was probably just a wrong usage of import { Linkify } from ...
instead of import Linkify from ...
on my end. Basically that's what the error describes.
Furthermore: https://facebook.github.io/react/blog/2015/12/18/react-components-elements-and-instances.html
Out of the react docs:
An element is a plain object describing a component instance or DOM node and its desired properties. It contains only information about the component type (for example, a Button), its properties (for example, its color), and any child elements inside it.
An element is not an actual instance. Rather, it is a way to tell React what you want to see on the screen. You canโt call any methods on the element. Itโs just an immutable description object with two fields: type: (string | ReactClass) and props: Object1.
from react-linkify.
This looks like an importing issue as described and solved by @maksis. I'll update the README.
from react-linkify.
Related Issues (20)
- Linkify not working on contentEditable component HOT 1
- Support for clickable phone number
- package not working on mobile ( iphone & android ) HOT 1
- When I use dangerouslySetInnerHTML it doesn't linkify HOT 3
- Any chance for multiline support? HOT 1
- ESM import issue causing: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. HOT 1
- String text passed in as a value in <textarea> does not seem to be supported with react-linkify HOT 1
- Can't identity the links with whitespaces HOT 1
- Error when using "react-linkify" in a Next.js app
- Quoted email addresses do not link properly
- Email addresses will not parse correctly HOT 1
- Latest Dist is not latest build HOT 2
- The properties don't work when in Semantic UI <Comments> HOT 13
- Readme and example site is outdated HOT 2
- Homograph attack (Security) HOT 2
- Invariant Violation HOT 2
- import { linkify } from "react-linkify" gives undefined HOT 6
- Props don't work HOT 1
- Target Blank Doesn't Work HOT 16
- React Linkify - Properties is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-linkify.