Skip to content

Commit

Permalink
changed to named export
Browse files Browse the repository at this point in the history
  • Loading branch information
VirtualParticle committed Jun 13, 2021
1 parent bcfc73d commit e123da1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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() {

Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import ToggleSlider from "react-toggle-slider";
import { ToggleSlider } from "react-toggle-slider";

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-toggle-slider",
"version": "0.2.2",
"version": "0.3.0",
"author": {
"email": "[email protected]",
"name": "Mark Vadeika"
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function ToggleSlider({
);
}

export function useToggleSlider(props?: ToggleSliderProps) {
function useToggleSlider(props?: ToggleSliderProps) {

const [activeState, setActiveState] = useState(props?.active ?? false);

Expand All @@ -137,4 +137,4 @@ export function useToggleSlider(props?: ToggleSliderProps) {

}

export default ToggleSlider;
export { ToggleSlider, useToggleSlider };

0 comments on commit e123da1

Please sign in to comment.