Skip to content

Instantly share code, notes, and snippets.

View rizkiramadhanx's full-sized avatar
🤯
Study Hard

oji rizkiramadhanx

🤯
Study Hard
View GitHub Profile
@rizkiramadhanx
rizkiramadhanx / cn utils (Reusable Component)
Created January 31, 2024 04:52
cn utils (Reusable Component)
import { ClassValue } from "class-variance-authority/types";
import clsx from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
import { useForm } from "react-hook-form";
const Validation = () => {
const {
register,
handleSubmit,
formState: { errors, isValid }
} = useForm({ mode: "onBlur" });
const onSubmit = (data) => {
import { useForm } from "react-hook-form";
const DefaultValue = () => {
const { register, handleSubmit } = useForm({
defaultValues: {
firstName: "oji",
lastName: "ramadhan"
}
});
.App {
font-family: sans-serif;
color: black;
}
.borderRed {
border: 2px solid crimson;
}
*:focus {