🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

usestep-storage-ts

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

usestep-storage-ts

This hook can be used to control each step of a form that was made with the idea of showing each step in the necessary time, thus helping to further componentize a form in react. The Hook stores the state in localstorage and even with the page update it r

1.1.1
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

usestep-storage-ts

Este é um hook personalizado feito com TypeScript para aplicações ReactJS e NextJS que permite salvar o passo ou (step) atual de um formulário mesmo quando o navegador é fechado ou recarregado.

Instalação

Você pode instalar este pacote com o seguinte comando:

npm install usestep-storage-ts

ou

yarn add usestep-storage-ts

Uso

Você pode usar este hook da seguinte maneira:

import useStep from 'usestep-storage-ts'

export default function MyComponent() {
   const [step, setStep] = useStep('key', 0)

   return (
      // restante do projeto
   )

}

O primeiro argumento é a chave (string) que será usada para salvar o passo ou (step) no localStorage do navegador. O segundo argumento é o valor padrão caso não haja nenhum valor salvo anteriormente.

Contribuição

Se você deseja contribuir para este pacote, por favor, abra uma issue ou envie uma pull request. Todas as contribuições são bem-vindas!

Certifique-se de atualizar os testes conforme apropriado.

Licença

Este pacote está sob a licença MIT. Veja o arquivo MIT para mais informações.

Keywords

react

FAQs

Package last updated on 09 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts