Tag Archives: VOID

You do not want void 0

You don't need void 0

In JavaScript code, particularly in older legacy code, you typically discover the expression void 0. The void operator evaluates an expression and returns the primitive worth undefined. void 0 evaluates 0, which does nothing, after which returns undefined. It’s successfully an alias for undefined. Why is void 0 used as an alias for undefined? Certainly…

Read More

Don’t use Function Components, use Void Function Components – Learn from Tutorial

Don’t use Function Components, use Void Function Components One thing you’ll come across when using Typescript with React is giving types to your components. Most places I’ve seen will use React.FC for this: const MyButton: React.FC<MyButtonProps> = ({prop1, prop2}) => { //… } Enter fullscreen mode Exit fullscreen mode And while React.FC is an actual…

Read More