Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Has he come across an "import { this } from 'that';" statement yet? That'll be sure to trigger him. Lol
-
One benefit of using props is: when you convert your file into typescript, it’s easier to attach interface into it 🤔
-
@Commodore I mean easy to add interface to your code with minimal line changes.
Eg:
(props: IMyComponentProps) => ...
interface IMyComponentProps {
id: number;
...
}
I can't use Javascript object destrucuring in react components because a colleague doesn't like / understand it for some reason.
So instead of:
({ something }) => {
return (
<div>{something}</div>
)
}
If have to use
(props) => {
return (
<div>{props.something}</div>
)
}
Its no big issue, but I hate it.
rant
react
javascript