I believe the world is better without mobile applications.
There is alternative to mobile applications. Mobile application can be replaced by the modern web-browsers that fully support HTML5 like Chrome, FireFox and Safari.
Using NextJs, the default framework of ReactJS, I have been building a…
In this post, I would like to share my own custom hook that turns a DOM element into a dropzone where visitors can submit their file into your react application. The hook is less than 100 lines of code. It is very tiny and works fast.
Before you read this post, I assume you are familiar with how react.useEffect and custom hook work in general because detailed explanation regarding them is not provided.
The images below are a kind of dropzones that the hook can create. It is a custom hook, which only provides minimal logic. …
The Typescript documenation sets out a dozen of utility types. After using some of them, I was fasinated. They made my code much neater. I did not know even they are existing before.
In case you are missing them like me 2 days ago, I will breifly introduce the concept of utility types and two of them I frequently use.
When you work on Typescript projects, you may encouter a situation where you are tempted to construct a new type that is just “slightly” different from an existing one.
As a developler who takes the DRY(“Don’t Repeat Yourself”) principle very…
In this blog, I would like to share how I publish my own react components to Node Package Manager or NPM. There are many ways to achieve the same goal. I tried many of them. But I think this is the easiest and quickest one I ever found.
First of all, for those who wonder why we should consider publishing the components, I would point out one major benefit of doing that.
It improves modularization and re-usability: You may have heard that it is always recommended to keep the components as small as possible. By keeping it small, the components…
As I see dozens of cryptocurrencies’ price up and down 24/7, I always wondered what kind of genius made them because I know the fact that the mathematics behind the blockchain technology is intimidatingly complex.
Let me make the terms clear first. Sometimes people use the terms “coins” and “tokens” interchangeably. As far as I know, there is no legal definition between them. However, usually coins refer to cryptocurrencies that have its own blockchain such as “Bitcoin” or “Ethereum” whereas tokens refer to cryptocurrencies on other coin’s blockchain such as Tether or BitTorrent. …
This blog is about how to check if a string value in “yyyymmdd” format is valid date. The TypeScript code below is the function that I have created.
The function returns true only if the date exists on the calendar.
If you are reading this blog, you probably know that new Date(2021, 2, 29) returns 2021–3–1, not throwing an error or returning false even though 2021–2–29 does not exist on the calendar.
I made this function returns false when the date overflows the month. I tried to check the 5th and 6th characters such as “02” in the example…
This is a node project module I have created and managed. It is a collection of trivial functions I often use in multiple projects. This blog is documentation of the module explaining how to use each function inside this module and why I made them.
I made this module in order to prevent myself from coding the same functions in different projects over and over. Accordingly, the functions here are all for general purposes.
I know that I could simply use great modules created by other great programmers such as lodash. But I strongly believe the statement “if you do…
As you handle more than one project, you may encounter situations where you have to code trivial functions repeatedly across the projects.
As a sincere DRYer (Don’t Repeat Yourself), in order to avoid it, I package the frequently-used-functions using the npm(also known as Node Package Manager). Then, all I have to do is to install the package and use it without repeating myself in every other project.
In this blog, I will share how I package the functions for reusing them in various other projects. The package is written in typescript and compiled & distributed with the extension of .d.ts…
The answer is we don’t and we do. It depends. If you want to make your code more concise and neat, adopting custom hook may help you.
There are so many new concepts and techniques emerging in the software world. Sometimes, I sometimes ignore and avoid them on purpose.
Custom hook was one of them, but not any more to me.
I used React for a year and now I got to understand what custom hooks do and why they are useful.
First of all, take a look at what the official document says.
Building your own Hooks lets you…