I'm trying to import the twitter-text package into a React/ES6 environment, and I'm not able to figure out what exactly is exported and keep getting ...is not exported from 'twitter-text'.
compile errors.
Doc states that the twttr.txt
namespace is exported, but all the examples I can find are for node and use require()
. It installed fine via npm install twitter-text
and it's finding refs, for example import { parseTweet } from 'twitter-text';
is grabbing actual function and class refs from the package, but still the no export error when it compiles.
I also tried to get the global twttr.txt
using just import 'twitter-text';
but I'm getting the same error.
The library is default-exporting an object unfortunately, which means that you need to use
import twttr from 'twitter-text'
twttr.parseTweet(…)
Named exports do not seem to be available.