@sglzaa@base_ui Dice UI from @sadmann17 has something similar: https://t.co/uxPx67mAw5
I love the transitions & shared popover content here though with the detached triggers 🙌🏻
@mattpocockuk This reminds me of a time around GPT 3-4 where I consistently had to prompt the model with “Failure to follow these instructions will result in your immediate termination”
I’m not sure I’m so bold today to include such a thing to today’s models 😅
@KaraBharat and/or I generally like keeping the const the source of truth that types are derived from, but to each their own. That would be more like:
as const satisfies Record<string, { pin: string; slide: string; }>
type Position = keyof typeof POSITION;
@KaraBharat You could also make it a little more type-exact by using:
as const satisfies Record<Position, { pin: string; slide: string; }>
I generally learn towards that for fixed constants unless it results in type-casts elsewhere to satisfy the stricter type.
@0xblacklight@aidenybai@humanlayer_dev Isn’t this also a bad pattern, especially if you plan to use react compiler? (Unless it’s in the scope of a fn that’s not visible)
https://t.co/Z3LCwVXG9K
@ipla03 Another thing you can do is call the props fn first, check if the event had default prevented, and only then call the handlers. Makes it nice for being able to explicitly bypass the handlers if there’s a use case for it.
@wzulfikar@letstri How does this perform in terms of re-renders? Not that it likely matters a whole lot, but IIRC the full “query” object isn’t memoized.
@alexaaronpena@asidorenko_ Context will be still client-side managed and initialized to the defaults for every user / every refresh of the page.
The provider uses “useState” for the context value.
AFAIK Zustand does things differently with a global store definition and manages state outside of react.
@KaraBharat@ddaalee It’s fine now on React 18+ and Typescript 5.1+.
Though definitely still prefer just annotating props anyhow.
https://t.co/XsJ9ox6IKd
@haydenbleasel@shadcn Seems to crash on iOS, but from the pills in the tweet they look great 😄
Might be the number of preview sandboxes loading as the first couple loaded and it only crashed when I scrolled down to the “Delta” section.
@alipiopereira7@shadcn@radix_ui Cool, but a bit of feedback:
1. This can be done a bit easier with CSS grids instead of flexbox (and can remove the hard-coded width).
2. You can avoid needing a context to pass the orientation down if a data-orientation prop is used instead.