HTML to PDF converter for your React Application

Here, I’ll show you how to use jsPDF (html to pdf converter) in your React application which supports all modern CSS including flexbox. Consider the below one as your sample App component. Now, install jspdf library by using the below command. Then, you can import jspdf in the App component. Now, I’m going to replace … Read more

Input Field is not Editable – React JS Fix

If the value of your input field is not changing or editable, then you can try the following solution. This may happen when your field doesn’t have an onChange event or the value attribute is not updating. Consider the below one as your sample component. Since the value attribute is not updating, it’s not possible … Read more

How to Pass Data from Child Component to Parent Component with React?

I think this is one of the most asked questions when you are on the learning path to React. Since React is unidirectional, it’s not possible to pass data from child component to parent component directly. It doesn’t mean that your child component can’t communicate with the parent component. You can still achieve this by … Read more

ComponentWillUnmount with React Hooks

Since we don’t have any lifecycle methods in React functional components, we will make use of the hook useEffect to achieve the same behavior. You can also check my other blog posts where you can do componentDidMount and componentDidUpdate with hooks. Basically, componentWillUnmount is used to do something just before the component is destroyed. Mostly, … Read more

ComponentDidUpdate with React Hooks

We can make use of the hook useEffect in order to achieve the same behavior of componentDidUpdate in the class components. useEffect hook receives a callback function that will execute when the component is mounted and whenever it updates. You can also check my other blog posts where you can do componentDidMount and componentWillUnmount with hooks. Let’s … Read more

ComponentDidMount with React Hooks

We will be using the useEffect hook in the functional component to achieve the same behavior of componentDidMount in the class components. You can also check my other blog posts where you can do componentDidUpdate and componentWillUnmount with hooks. Let’s go through an example of componentDidMount. First, we will be importing useEffect hook from the react library. … Read more