From 1fea72da0f262ffc87a1fe45d650be7f6d735ee8 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..834f4f5 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 bce5661..bf07bbf 100644 --- a/src/waypoint.jsx +++ b/src/waypoint.jsx @@ -29,7 +29,7 @@ const BaseClass = typeof React.PureComponent !== 'undefined' ? React.Component; // Calls a function when you scroll to the element. -export default class Waypoint extends BaseClass { +export class Waypoint extends BaseClass { 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';