Toggle theme

React Utils🔗

@volvo-cars/react-utils

@volvo-cars/react-utils
@volvo-cars/react-utils
@volvo-cars/react-utils

This package exposes useful generic hooks that don't belong to a hook collection (like react-layout-utils)

Installation🔗

💡 This package includes Typescript definitions


usePrevious🔗

Returns the previous value of a passed prop or state.

Name
Description
Type
Default Value
valueThe property you wish to know the previous state of post re-renderunknownundefined

useKeyPress🔗

Adds an event listener on component mount that invokes the provided callback function on matching key(s)press.

Name
Description
Type
Default Value
keysToListenToComma or space delimited list of keys to listen tostringundefined
callbackFunction to be invoked on keypressfuncundefined

2022 © Volvo Car Corporation