From e123da1465bf266b83647e10f5ae2f3d9213da73 Mon Sep 17 00:00:00 2001 From: Mark Vadeika Date: Sun, 13 Jun 2021 01:43:26 -0400 Subject: [PATCH] changed to named export --- README.md | 14 ++++++++++++-- example/src/App.tsx | 2 +- package.json | 2 +- src/index.tsx | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0b7046c..dfac1ea 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,22 @@ A highly customizable React toggle slider component. +## Installation + +Install using NPM: + +`npm install react-toggle-slider` + +Or install using Yarn: + +`yarn add react-toggle-slider` + ## Usage To add the component, simply import `ToggleSlider` and use it in your app. ```tsx -import ToggleSlider from "react-toggle-slider"; +import { ToggleSlider } from "react-toggle-slider"; function App() { return ( @@ -61,7 +71,7 @@ similar to represent the status on the page. ```tsx -import ToggleSlider from "react-toggle-slider"; +import { ToggleSlider } from "react-toggle-slider"; function App() { diff --git a/example/src/App.tsx b/example/src/App.tsx index 14c39fc..274c541 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,5 +1,5 @@ import React from "react"; -import ToggleSlider from "react-toggle-slider"; +import { ToggleSlider } from "react-toggle-slider"; function App() { return ( diff --git a/package.json b/package.json index 7a9522d..f699b0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-toggle-slider", - "version": "0.2.2", + "version": "0.3.0", "author": { "email": "markvadeika@gmail.com", "name": "Mark Vadeika" diff --git a/src/index.tsx b/src/index.tsx index ffe55eb..e681b1d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -125,7 +125,7 @@ function ToggleSlider({ ); } -export function useToggleSlider(props?: ToggleSliderProps) { +function useToggleSlider(props?: ToggleSliderProps) { const [activeState, setActiveState] = useState(props?.active ?? false); @@ -137,4 +137,4 @@ export function useToggleSlider(props?: ToggleSliderProps) { } -export default ToggleSlider; +export { ToggleSlider, useToggleSlider };