Why there is a difference of usage between the import
statement and the require
statement in different parts of the project directories using these frameworks, answered.
I had always thought that JavaScript import
and require
statements to be more or less the same. When you want to use other components and functionalities from different files or modules, you would either import
or require
it to the file you are working on. The only difference between import
and require
statements, I thought, was due to the former being the ‘newer’ version of the latter. Nothing else.
My preconception was proved wrong when working on a project using the Gatsby framework. I had no trouble using either import
or require
statements when writing codes inside the src
directory. However, when it came to configuring the app on files that sits on the root directory, errors started to emerge when using the import
statement. After digging into the issue, here is what I found out. …
Mercantilism gained tract in the late 16th century. We follow the story of how it came to be and its fall from grace as the main economic policy of that age. We end by asking whether mercantilism still exists in this modern world.
Mercantilism in Europe began in late 16th to early 17th century with the Dutch puzzle: how is it that a newborn nation with little to no natural resource managed to become one of the richest and most powerful state in Europe in a span of just a couple of decade? The United Provinces of the Netherlands or most commonly known as the Dutch Republic (an area we know today as the Netherlands and some parts of Belgium) was the first independent Dutch Nation state. It gained independence from the Kingdom of Spain which was ruled by the Hapsburgs. The signing of the Union of Utrecht in 1579 marked the beginning of the Dutch Nation state. In a couple of decades, that new independent Republic had transformed into the richest and most powerful nation in Europe. …
You have setup and created your react app (using create-react-app, other boilerplates, or even creating it from scratch). Now you’re trying to serve it to the web so people can experience your app. Sure, for easy deployment and minimal setup you can go for the already established platforms such as Netlify, Heroku, Firebase Hosting, Github Pages, or many others. This article, however, is not about that. This article is about setting up your own server and deploying your site/app using good ol’ Express.js.
Why, you may ask? For learning purposes, of course. Having an understanding of how servers deliver your app/site is beneficial for your programming fundamentals. …
You have setup and created your react app (using create-react-app, other boilerplates, or even creating it from scratch). Now you’re trying to serve it to the web so the world can see what you’ve made. Sure, for easy deployment and minimal setup you can go for the already established platforms such as Netlify, Heroku, Firebase Hosting, Github Pages, or many others. This article, however, is not about that. This article is about setting up your own server and deploying your site/app using good ol’ Express.js.
Why, you may ask? For learning purposes, of course. Having an understanding of how servers deliver your app/site is beneficial for your programming fundamentals. …
Nowadays, starting a React app is as simple as typing a line of command into the terminal, taking for granted what happens under the hood. We use create-react-app or other boilerplates to start the development process and dive straight into the actual React code.
However, it would be a great learning experience (especially for those who are beginners) to set up a react app from scratch on your own. It will cement your understanding of the bits and pieces that goes into a react application from scratch to deployment. …
Keeping states between pages in a React application can be tricky. This article explains how to keep states persistent in a Next.js based React application using Recoil.js. Before reading this article, one should have a basic understanding of React.
Next.js is a React-based framework for building complete web applications. Next.js provides more functionalities (such as styling and routing solutions) than your typical create-react-app for faster and easier web app building.
As a react-based application, state management can be done using built-in state (setState
or useState
) and props, or context. …
According to its official documentation, Recoil is “a state management library for React”. There are a couple of reasons why Recoil is best chosen to manage states in a react application rather than using React’s built-in state management capabilities (including context).
Gatsby, on the other hand, “is a React-based open source framework for creating websites and apps”. Building web application using Gatsby can be fast and easy. Inside the Gatsby application, state management can be handled using Recoil.js.
Integrating Recoil in an existing React application, according to its documentation, is simple enough. After installing the Recoil package using either npm
or yarn
, one could just import RecoilRoot
component at the top of the application’s component tree and voila! …
Dalam dunia akuntansi, kita mengenal adanya suatu kerangka konseptual akuntansi. Tulisan ini merupkan bagian pertama dari rangkaian tulisan yang akan mengupas tuntas mengenai kerangka konseptual akuntansi. Pembahasan mengenai kerangka konseptual akan dibagi menjadi beberapa tulisan dan tulisan kali ini akan membahas tentang definisi kerangka konseptual, mengapa kerangka konseptual dibutuhkan, perkembangan kerangka konseptual dari waktu ke waktu, serta adopsi kerangka konseptual di indonesia, yang dijelaskan menggunakan bahasa yang sesederhana mungkin.
Menurut Kieso, Weygandt, dan Warfield, suatu kerangka konseptual “establishes the concepts that underlie financial reporting”. Sementara, di dalam Conceptual Framework for Financial Reporting 2018 dijelaskan bahwa: “The Conceptual Framework for Financial Reporting (Conceptual Framework) describes the objective of, and the concepts for, general purpose financial reporting”. Dari kedua definisi tersebut dapat disimpulkan bahwa kerangka konseptual akuntansi merupakan sekumpulan konsep-konsep yang mendasari pelaporan keuangan. Yang dimaksud konsep-konsep dasar pelaporan keuangan yaitu gagasan-gagasan serta ide mengenai apa yang seharusnya dilaporkan dalam laporan keuangan serta bagaimana melaporkannya. …
About