Follow

REACT DON'T DO IT 

Uncaught Error: The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.

---

Disgruntled Old Man Me:

Back in my day the only property that any attribute would take is a string.

---

and for fun, this is the line of code that threw the error:

<div style="margin: 0 auto;">

and what it wants me to do is:

<div style={{margin: "0 auto"}}>

Β· Β· 1 Β· 0 Β· 1

re:REACT DON'T DO IT 

@tychi

> Back in my day the only property that any attribute would take is a string.

good old stringly-typed API

re:REACT DON'T DO IT 

@codesections i'm waiting on the equivalent of XHTML 1.0 Validator Badges but for TypeScript before migrating πŸ˜‚

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.