This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Grid Table */ | |
| .gridTable { | |
| display: grid; | |
| border-collapse: collapse; | |
| width: 100%; | |
| grid-template-columns: repeat(3, auto); | |
| border: #36304a solid 1px; | |
| background: #fff; | |
| border-radius: 10px; | |
| overflow: hidden; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1 install | |
| npm install class-variance-authority clsx tailwind-merge | |
| // 2 /lib/utils.ts | |
| /* | |
| clsx handles conditional logic and class composition | |
| tailwind-merge removes conflicting Tailwind classes | |
| */ | |
| import { clsx } from "clsx" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1 install | |
| npm install zustand | |
| // 2 create | |
| // store.js | |
| import { create } from 'zustand'; | |
| const useStore = create((set) => ({ | |
| count: 0, // Initial state | |
| increase: () => set((state) => ({ count: state.count + 1 })), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| /** | |
| * ============================================================ | |
| * VARIANTA 1 | |
| * Jednoduchá request-level cache pomocí static proměnných | |
| * ============================================================ | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useRef, useState } from "react" | |
| import { checkEmail, checkPassword } from "./validators" | |
| export function RefForm() { | |
| const emailRef = useRef() | |
| const passwordRef = useRef() | |
| const [emailErrors, setEmailErrors] = useState([]) | |
| const [passwordErrors, setPasswordErrors] = useState([]) | |
| const [isAfterFirstSubmit, setIsAfterFirstSubmit] = useState(false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useLocalStorage } from "./useLocalStorage" | |
| function App() { | |
| const [firstName, setFirstName] = useLocalStorage("FIRST_NAME", "") | |
| const [lastName, setLastName] = useLocalStorage("LAST_NAME", () => { | |
| return "Default" | |
| }) | |
| const [hobbies, setHobbies] = useLocalStorage("HOBBIES", [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState, useCallback } from "react" | |
| export function useArray(initialValue) { | |
| const [array, setArray] = useState(initialValue) | |
| const push = useCallback(element => { | |
| setArray(a => [...a, element]) | |
| }, []) | |
| const replace = useCallback((index, newElement) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _ |
NewerOlder