Filter
Exclude
Time range
-
Near
🎯 Become a Front-End Web Developer: The Ultimate Guide Front-end web development is an exciting and rewarding career. If you want to build stunning websites and web apps, this guide will help you become a professional front-end developer. A thread 🧵👇🏻👇🏻 #HTML #HTMLTutorial #LearnHTML #HTMLForBeginners #HTML5 #WebDevelopment #FrontendDevelopment #WebDesign #HTMLBasics #Coding #Programming #HTMLTags #HTMLForms #HTMLTables #HTMLAndCSS #HTMLAttributes #HTMLWebsite #HTMLFullCourse #react #javascript #HTMLStepByStep #HTMLElements #HTMLEssentials #code #coding
33
18
102
3,543
And if TS gets mad you can do this: declare module 'react' { interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> { _variant?: "default" | "outline"; } }
2
5
106
What is at the root of your website looking so beautiful? It's the HTML code! Read how HTML plays a inevitable role in web designing at: tinyurl.com/w2vcxd7n #html5 #FrontEnd #coding #programminghelp #htmltags #htmlattributes @html @html_to_design @html5gamedevs

1
4
51
26 Apr 2024
Actually, I am wrong. HTMLAttributes<HTMLDivElement> doesn’t have “ref”.
2
23
Replying to @mattpocockuk
Typing `data-` attributes in HTMLAttributes via `data-${string}?: string | undefined`. In case anybody wants to contribute that 😉 Currently only works in JSX via <div data-foo="a" />. Not when you try to construct an actual object e.g. props: HTMLAttributes = { 'data-foo': a}
2
299
Replying to @JonasBadalic
> removing unions over HTMLAttributes What do you mean? Got an example?
1
994
5 Mar 2024
Replying to @mattpocockuk
It was 90% just removing unions over HTMLAttributes, not super interesting I guess, but those types are massive
1
6
1,183
5 Mar 2024
The highest perf issues basically boiled down to unions over large types like React.HTMLProps or HTMLAttributes This was my POC PR that I broke down into smaller ones (you can search PR's with me as the author and use interface/typescript as they keyword to see examples) github.com/getsentry/sentry/…

7
257
27 Aug 2023
[13/100] Descobri pelo @edusantosbrito que esses tipos declarados não precisam ficar lá. O ButtonHTMLAtributes faz extends em HTMLAttributes, que já possui o tipo className, e também herda do DomAttributes, onde children já está definido. #100DiasDeCodigo #100DaysOfCode
1
1
16
697
Replying to @Kosai106
Yeah but the typings are annoying: const SettingsSection = (props: Omit<HTMLAttributes<HTMLDivElement>, 'className'>) => {}
2
2
2,883
type Props = DetailedHTMLProps<HTMLAttributes<HTMLButtonElement>, HTMLButtonElement> mais plutôt : type Props = ComponentPropsWithoutRef<"button">
1
4
731
Awesome work! One super useful technique that I think deserves to be added here is typing { ...props } by extending the interface with they types from a DOM interface. ex: interface MyButton extends HTMLAttributes<HTMLButtonElement>
2
65
If you want it to work in every file, use declare global instead. HTMLAttributes doesn't actually belong to the react module itself, React just overwrites it.
1
5
424
Which would you use to mirror an HTML element in a custom component? 🔹ComponentPropsWithoutRef 🔹ComponentProps 🔹InputHTMLAttributes 🔹JSX.IntrinsicElements 🔹HTMLAttributes 🔹HTMLProps
4
1
35
2,061
Replying to @sergioyorick
This thread is saved to your Notion database. Tags: [Htmlattributes]
27 Sep 2022
Yes, very similar. Although I ideally want to make this something most of us never reach for and instead provide the interfaces like HTMLAttributes directly, as shown later in this thread
3
I found a very subtle utility function for tailwind users to add classNames responsively. export const withDesktopStyle = ( classNames: HTMLAttributes<HTMLElement>['className'] ) => { return ` ${classNames}`.split(' ').join(' lg:'); }; 👀👀
4