Skip to content

A Library, which holds a plenty of hooks, is useful for developers to minimize their code and make their lives easier

Notifications You must be signed in to change notification settings

AmeerAsif777/react-custom-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-custom-hook


In this library, there are a plenty of hooks which helps us to optimize our code and makes our lives easier.

If you are react developers, you must know about useState hook

import { useState } from 'react';
const [value, setValue] = useState('');

You might wonder, how to know both previous and current state value at the same time. Here, it comes

import { usePreviousCurrentState } from 'react-custom-hook';

const [previousValue, currentValue, setValue] = usePreviousCurrentState('');

Explanation

previousValue is a variable that holds previous value.
currentValue is a variable that holds current value.
setValue is a function that lets us to update current value.

About

A Library, which holds a plenty of hooks, is useful for developers to minimize their code and make their lives easier

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published