More Premium Hugo Themes Premium React Themes

Remix Params Helper

This package makes it simple to use Zod with standard URLSearchParams and FormData which are typically used in Remix apps.

Remix Params Helper

This package makes it simple to use Zod with standard URLSearchParams and FormData which are typically used in Remix apps.

Author Avatar Theme by kiliman
Github Stars Github Stars: 248
Last Commit Last Commit: Nov 24, 2023 -
First Commit Created: Aug 27, 2024 -
Remix Params Helper screenshot

Overview

The Remix Params Helper is a powerful package designed to streamline the use of Zod with URLSearchParams and FormData in Remix applications. It cleverly reduces boilerplate code and enhances the user experience when validating and parsing data. Despite being a work in progress, with ongoing refinements and updates, this tool already showcases its value by simplifying the handling of untyped data inputs.

The recent updates have introduced significant enhancements, such as improved error handling and support for nested objects and arrays. This ensures you can implement robust validation effortlessly while maintaining a clean codebase.

Features

  • Effortless Data Validation: Use the getParams, getSearchParams, and getFormData functions to easily parse and validate inputs from different sources, returning a clear structure of success or error messages.

  • Customizable Error Messages: Zod allows you to define custom error messages directly in your schema, enhancing the clarity of validation feedback for users.

  • Support for Nested Objects and Arrays: The API now accommodates nested structures and arrays, allowing for more complex data organization with ease.

  • OrFail Functions: With the introduction of getParamsOrFail, getSearchParamsOrFail, and getFormDataOrFail, you can streamline error handling, automatically throwing errors on validation failures.

  • Improved Input Handling: The useFormInputProps function dynamically sets input element properties based on your Zod schema, simplifying form management within your applications.

  • Peer Dependency on Zod: This helper package is designed to work seamlessly with Zod, making it easier to integrate into existing setups and leverage powerful validation features.

  • Multi-value Key Support: The helper accommodates multi-value keys during parsing, converting them into arrays for straightforward management.