Tag Archives: javascript

Img tag handler for incorrect image link

hey, Let’s say you have image tag and src link appears to be incorrect one: image does not exist for that address. We can use onError img attribute to add handler for this situation. Below I will add React code as example. In the snippet, we added fallback in case our src is not available.

Custom Element in Array type in Typescript

Sometimes you need to do something like this: The issue here is, that most probably makes hard for your fellow developer to read and understand that code because he/she does not expect array type to contain any custom fields. But still you might have reasons to do that, for example, ‘someArray’ is created in other […]