Skip to content

Commit 258cdeb

Browse files
committed
Fix autolinker import issues [Closes #36]
1 parent e6fd560 commit 258cdeb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import React, { Component, createElement } from 'react';
1010
import PropTypes from 'prop-types';
11-
import Autolinker from 'autolinker';
11+
import { Autolinker, AnchorTagBuilder } from 'autolinker/dist/es2015';
1212
import {
1313
Alert,
1414
Linking,
@@ -19,7 +19,7 @@ import {
1919
import * as Truncate from './truncate';
2020
import matchers from './matchers';
2121

22-
// const tagBuilder = Autolinker.prototype.getTagBuilder();
22+
const tagBuilder = new AnchorTagBuilder();
2323

2424
const styles = StyleSheet.create({
2525
link: {
@@ -249,7 +249,7 @@ export default class Autolink extends Component {
249249
const matchedText = args[0];
250250

251251
matches[token] = new Match({
252-
// tagBuilder,
252+
tagBuilder,
253253
matchedText,
254254
offset: args[args.length - 2],
255255
[id]: matchedText,

src/matchers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* https://github.com/joshswan/react-native-autolink/blob/master/LICENSE
77
*/
88

9-
import { Match } from 'autolinker';
9+
import { Match } from 'autolinker/dist/es2015';
1010

1111
export default [
1212
// LatLng

src/truncate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* https://github.com/joshswan/react-native-autolink/blob/master/LICENSE
77
*/
88

9-
import { truncateEnd as end } from 'autolinker/dist/commonjs/truncate/truncate-end';
10-
import { truncateMiddle as middle } from 'autolinker/dist/commonjs/truncate/truncate-middle';
11-
import { truncateSmart as smart } from 'autolinker/dist/commonjs/truncate/truncate-smart';
9+
import { truncateEnd as end } from 'autolinker/dist/es2015/truncate/truncate-end';
10+
import { truncateMiddle as middle } from 'autolinker/dist/es2015/truncate/truncate-middle';
11+
import { truncateSmart as smart } from 'autolinker/dist/es2015/truncate/truncate-smart';
1212

1313
export {
1414
end,

0 commit comments

Comments
 (0)