Feature | Vue.js (Slots & Dynamic Component) | React (Render Props, JSX, HOCs) |
---|---|---|
Customization | Explicit via slots or dynamic components | Implicit via JSX or render props |
Flexibility | Very flexible (structured slots) | Flexible, but requires setup |
Type Safety | Maintains type integrity | JSX elements can be mixed types |
Performance | Direct rendering, no extra function calls | Render props and HOCs add slight overhead |
Best For | Deep component customization | Conditional rendering inside components |
This file contains 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
autoload -Uz compinit && compinit | |
autoload -Uz add-zsh-hook | |
autoload -Uz vcs_info | |
add-zsh-hook precmd vcs_info | |
zstyle ':vcs_info:*' enable git | |
zstyle ':vcs_info:*' formats " %F{cyan}%c%u(%b)%f" | |
zstyle ':vcs_info:*' actionformats " %F{cyan}%c%u(%b)%f %a" | |
zstyle ':vcs_info:*' stagedstr "%F{green}" |
This file contains 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
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
import { MessageRate } from "../../types/message.types" | |
import { messageHandler } from "./eventHandler" | |
import { ratingMessageHandler } from "./onMessageHandlers/ratingMessageHandler" | |
jest.mock("./onMessageHandlers/ratingMessageHandler") | |
describe("messageHandler", () => { | |
const sendResponseMock = jest.fn() |
This file contains 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
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
import { JestChrome } from "jest-chrome/types/jest-chrome" | |
import { ratingMessageHandler } from "./ratingMessageHandler" | |
import { MessageRate } from "../../../types/message.types" | |
describe("ratingMessageHandler", () => { | |
const sendResponseMock = jest.fn() | |
const jestChrome = chrome as any as JestChrome | |
beforeEach(() => { |
This file contains 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
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
import { JestChrome } from "jest-chrome/types/jest-chrome" | |
import { getRateFromCache } from "./getRateFromCache" | |
describe("getRateFromCache", () => { | |
const sendResponseMock = jest.fn() | |
const jestChrome = chrome as any as JestChrome | |
beforeEach(() => { | |
jest.clearAllMocks() |
NewerOlder