Simple way to validate search params in Next 15

Поделиться
HTML-код
  • Опубликовано: 6 фев 2025

Комментарии • 4

  • @WebDevEducation
    @WebDevEducation  Месяц назад

    NOTE: In this scenario it's better to not actually include the .optional(), that way cfyear will always have a value and not potentially be undefined.

  • @tauhid97k
    @tauhid97k Месяц назад +1

    Thanks. This is amazing. Can we do the same with "nuqs" library somehow? I have no idea.

    • @WebDevEducation
      @WebDevEducation  Месяц назад +1

      I don't think nuqs validates the params within a server components

  • @trifke027
    @trifke027 Месяц назад +1

    So basically you just advertise your package here, instead of showing how to truly do it in Next