24. Order of props matters!
This is part of a series of posts about writing component API for great developer experience.
Here’s part #1 and #2 if you missed it: Writing good component API
Today, let's start with a simple React component which renders an anchor tag:
<Link href="sid.studio">Click me</Link>
// will render:
<a href="sid.studio" class="link">Click me</a>
And here's what the code for the component looks like:
const Link = props => {
return (
<a href={props.href} className="link"
>
{props.children}
</a>
)
}
Wait, does that code block look weird and the indentation is all messed up?
It's close to impossible to make code look pretty in an email 😅
Continue reading on my blog - I promise it looks way better over there:
Order of props matters!
See you on the blog!
Sid
Don't miss what's next. Subscribe to Sid's newsletter: