Defining API functionsWhen I'm developing a web application I prefer to abstract the server communication logic into asynchronous functions. Usually I would have an api.(js|ts) module where I would have a function for each endpoint. For example if I want to make a GET req...May 20, 2021 · 1 min readivanov.hashnode.dev
How to type React events with TypeScripthttps://youtu.be/3PtiSy8G-Cs Sometimes when you write React and TypeScript code, you have to define event handlers. How do you choose the correct event type for them? Let's say we have an onChange event handler called handleTextChange: function App()...May 20, 2021 · 2 min readivanov.hashnode.dev
React Dev ToolsTo develop React applications effectively - you’ll need to use React DevTools browser extension. It’s available for both Chrome and Firefox. It has two main features: view of a component tree and the current state and props of the selected component....Feb 27, 2019 · 3 min readivanov.hashnode.dev
Javascript `this`A lot of people find this keyword in Javascript very confusing. Depending on where is it used and defined it can have different value. This In Functions In normal Javascript functions this refers to global object. It will be window object in browser ...Feb 26, 2019 · 2 min readivanov.hashnode.dev
Handling Events In ReactJSHandling events in ReactJS is very similar to how it’s done on DOM elements. There are a few differences though. Event names are camelCased, so instead of onclick you have to use onClick: <button onclick="toggleDropdown()">Categories</button> // DOM ...Feb 25, 2019 · 2 min readivanov.hashnode.dev