Socket
Socket
Sign inDemoInstall

usestep-storage-ts

Package Overview
Dependencies
6
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

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


Version published
0
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 09 Feb 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc