Bart
Bart
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Bart on 3/27/2025 in #questions
Can I show component-specific props at the top of intellisense in VSCode??
When I'm using a React component that extends HTML elements, the intellisense dropdown shows me all the HTML attributes mixed in with the few custom props. For example, with something like <SandpackFileExplorer>, I have to scroll through dozens of aria-* attributes to find the 2-3 custom props that I am searching for. This makes it so I need to go to the docs or inspect the component to see which extra props are on an component. Is there any way (extension, setting) to make VS Code show component-specific props at the top of the intellisense dropdown? Thanks!
1 replies
TTCTheo's Typesafe Cult
Created by Bart on 12/6/2024 in #questions
How to add event listeners in React without useEffect
I heard theo say in multiple videos that useEffect should be used only when nececairy. I was wondering if there is a better way to add this event listener without using useEffect. useEffect(() => { const handleEscape = (e: KeyboardEvent) => { if (e.key === "Escape") setIsEditProfileModalOpen(false) } window.addEventListener("keydown", handleEscape) return () => window.removeEventListener("keydown", handleEscape) }, [])
6 replies
TTCTheo's Typesafe Cult
Created by Bart on 10/24/2024 in #questions
Is there an word wrap that works on editable contents? (not css)
I have an editable div on my landingpage that sends its textContext to a thermal printer which then prints it. I would like to have the exact line wrapping on my div as the thermal printer has, this means I cant use the css word wrap since that doesnt work with exact character count. There are a bunch of npm packages that have word wrap in them but all of them seem to be word wrapping a static text instead of a editable text by the user. Does anyone know if such a package exists or how to make it myself?
2 replies
KPCKevin Powell - Community
Created by Bart on 8/29/2024 in #front-end
Is there a way to make the text wrap around the picture in this grid layout?
No description
5 replies