@noaignite-dk/utils-next v2.4.15-1
Utilities for Nextjs
This is a collection of utilities for Nextjs. @see Noa Ignite DK
Dependencies
- Requires
react@18.x
or higher - Requires
next@12.x
or higher
Helpers
faac.tsx
Function As a Child Pass properties from the component to the child.
Note Useful for rendering either React {children} or function with properties as children.
fonts.tsx
Fonts
Helper for adding fonts with <link />
tags for the Next _documents.tsx
record_render.tsx
RecordRender
Return a specific component from a record, based on the passed id
.
Note Useful for rendering different components for different loading states.
server.tsx
Helpers for Server Side logic.
Available Hooks
use_click_outside.ts
Event hook for detecting click outside of an element.
Note Useful for popups/dialogs
use_delayed_state.ts
State hook with possibility for delaying.
Note Useful for simulating loading states.
use_disclosure.ts
State hook for toggling a state including callbacks
Note Useful for showing/hiding items
use_event_listeners.ts
Event hook for listening to events.
use_interval.ts
Event hook for setting an interval.
use_is_mounted.ts
State hook for detecting if component is mounted.
Note Useful for waiting for waiting for DOM to be ready.
use_isomorphic_layout_effect.ts
Ismorphic hook for running effects both on server and client side.
use_memo_key.ts
Hook returns a memorizable string based on a non-primitive value.
use_preserve_string.ts
State hook for preserving a string after it's been cleared.
Note Useful for showing error messages which value disappears
use_previous.ts
Reference hook returning the previous value of the reference.
use_query_state.ts
State hook for handling Router query.
Operates as a usual state hook, but sets/gets the value from the query instead.
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago