Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Higher Order Components in React - Example Tutorial
How to Create Custom hooks in React.js? Example Tutorial
The introduction of React hooks in React version 16.8 changed the React development completely. The web application development using React was mostly limited to class components because the state and lifecycle methods were not supported in the functional components. But with React hooks, the state can be used in functional components. Moreover, lifecycle methods like functionality can also be achieved using the useEffect hook.
How to do Type checking in React using PropTypes? Example Tutorial
How to use React forms in JSX? Example Tutorial
Introduction
Forms are an essential part of web application development. You can find forms on almost every website you visit. Forms are important because they are used to handle input from the users. Websites will not function properly if there is no way for input handling.
Input can be taken in various forms. The most common type of input is text input. Other forms of input are checkboxes, radio buttons, and ranges.
In React, forms are created like they are created in HTML. The most important part of forms in React is handling them. In this article, we will discuss how to create forms in React and handle them.
How to use "styled-components" in React? Example Tutorial
Introduction
Today, no website is complete without CSS. The user experience is heavily dependent on the CSS applied to the website. Without CSS, the website will look extremely unpleasant. So to make a website attractive and user-friendly, it is necessary to apply top-notch CSS.
Since its introduction in 1996, CSS has changed a lot. Over time CSS has undergone many changes and lots of new features are added to it. Moreover, to make the developer comfortable, CSS frameworks, libraries, and tools are invented. One such tool is styled-components and in this article, we will discuss what are styled-components and how to use them in React.
What is context API in React? Example Tutorial
Props and state are essential parts of a React component. While the state is controlled within the component, props are passed to it from the parent component. In a huge React application, a global state is generally created to pass the data around. Through props can also be used to pass data around multiple components but that can lead to unwanted situations. To avoid such unwanted situations, React provides the Context API. In this article, we will discuss what Context API is and how (and why) it is used.
How to use Context and useReducer for state management in React app? Example Tutorial
What is "render props" in React.js? Example Tutorial
Top 20 Hibernate Interview Questions with Answers for Java Programmers
How to Parse JSON in Java Object using Jackson - Example Tutorial
How to use useReducer in React.js and JavaScript? Example Tutorial
Introduction
Before the React hooks were introduced, it was not possible to use state in functional components. The React hooks transformed stateless functional components into stateful components in which state and lifecycle methods like functionality could be used.
The useState hook is the primary hook for declaring the state in a functional component. Using it, a state variable can be declared and initialized along with a function to manipulate it. But sometimes state gets complex and the useState hook is not efficient to handle it.
So React provides another hook for complex state management in functional components. This hook is called useReducer. In this article, we will discuss what useReducer hook is and how to use it.
7 Examples of HttpURLConnection in Java - Sending GET and POST Request [Tutorial]
Decorator Design Pattern Example in Java [Tutorial]
Difference between notify and notifyAll in Java? [Answered]
How to create a dynamic list in React? Example Tutorial
1. Introduction
Working with lists is common in React web development. Creating a static list is very easy but making it dynamic can be tough. Dynamic lists can generally be manipulated in one way or another. For example, a new item can be added to a list by entering a value in an input field or an item can be removed when it is clicked.
In this tutorial, we will learn how to create a dynamic list in which a new item can be added through an input field. Moreover, we will learn how to delete an item when clicked.
How to Solve Producer Consumer Problem in Java using BlockingQueue [Example]
Difference between CountDownLatch vs CyclicBarrier in Java Multithreading
Both CyclicBarrier and CountDownLatch are used to implement a scenario where one Thread waits for one or more Thread to complete their job before starting processing but there is one difference between CountDownLatch and CyclicBarrier in Java which separates them apart and that is, you can not reuse the same CountDownLatch instance once count reaches to zero and latch is open, on the other hand, CyclicBarrier can be reused by resetting Barrier, Once the barrier is broken.
Java 8 - Map and Reduce Example Tutorial
What is objects in JavaScript? Example Tutorial
JavaScript is a dynamically typed programming language. In JavaScript, it is not required to define the data type of a variable but that does not mean JavaScript does not have data types. Data types in JavaScript are divided into two categories - primitive and non-primitive.
Primitive data types such as numbers and strings can hold only a single value. But non-primitive types can hold more than one value. Objects in JavaScript are non-primitive.
If you have ever done programming, you may be familiar with the concept of objects because objects are one of the most important parts of programming. The reason is simple. Objects can hold multiple values. In this article, we will discuss objects in JavaScript.