From 0876d160b9367581f01c1b68b4f0d75da00b00ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Tue, 11 Dec 2018 16:15:27 +0100 Subject: [PATCH] Make Waypoint a named export. Fixes #238 --- README.md | 2 +- index.d.ts | 2 +- src/waypoint.jsx | 2 +- test/performance-test.jsx | 2 +- test/waypoint_test.jsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 05d079d..84b406a 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ yarn add react-waypoint ## Usage ```jsx -import Waypoint from 'react-waypoint'; +import { Waypoint } from 'react-waypoint'; { static invisible: string; } -export default Waypoint; +export Waypoint; declare namespace Waypoint { interface CallbackArgs { diff --git a/src/waypoint.jsx b/src/waypoint.jsx index 9c26942..c3a0faf 100644 --- a/src/waypoint.jsx +++ b/src/waypoint.jsx @@ -24,7 +24,7 @@ const defaultProps = { }; // Calls a function when you scroll to the element. -export default class Waypoint extends React.PureComponent { +export class Waypoint extends React.PureComponent { constructor(props) { super(props); diff --git a/test/performance-test.jsx b/test/performance-test.jsx index 8cb2477..19f5f8b 100644 --- a/test/performance-test.jsx +++ b/test/performance-test.jsx @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import ReactDOM from 'react-dom'; -import Waypoint from '../src/waypoint'; +import { Waypoint } from '../src/waypoint'; const WAYPOINT_COUNT = 1000; diff --git a/test/waypoint_test.jsx b/test/waypoint_test.jsx index a863cab..137ad33 100644 --- a/test/waypoint_test.jsx +++ b/test/waypoint_test.jsx @@ -1,7 +1,7 @@ /* eslint-disable react/no-multi-comp */ import React from 'react'; import ReactDOM from 'react-dom'; -import Waypoint from '../src/waypoint.jsx'; +import { Waypoint } from '../src/waypoint.jsx'; import { errorMessage as notValidErrorMessage } from '../src/ensureChildrenIsValid'; import { errorMessage as refNotUsedErrorMessage } from '../src/ensureRefIsUsedByChild';