Instead of this

For more details, read on

When working with React, there were cases where I had to pass props to a child component just to provide it as an argument to a function that was passed down to the same child component. Let’s look at this example.

Let’s say you created a login form using react-hook-form.

It will look something like this.

The first way that comes to mind is using the same component and maybe passing in some props and using css to customize the different components as needed. This might work if the second login component is the same or slightly different from the first one, but if you…

It can be tricky to debug a NodeJS application if you haven’t worked with docker for long. Let me save you some time!

The dockerfile I am using:

  1. Create a docker-compose.yaml for main configuration:
docker-compose -f docker-compose.yaml -f debug-compose.yaml

5. Go to your vscode debug panel (CTRL + SHIFT + D) select Docker: Attach to Node from the menu…

I recently had to write tests for a React app that used Redux, React Router and Apollo Graphql. I first tried using enzyme to render the components, but couldn’t get it

to work as intended, so I opted for the react-testing-library.

I took the example from and modified it to use apollo graphql test provider only if the `mocks` option is provided.

And for testing the component:


Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store