Skip to content

Instantly share code, notes, and snippets.

@romain-trotard
romain-trotard / Dockerize Github Action Workflow
Created June 22, 2023 19:08
Github action workflow to dockerize an application, publish it on registry and deploy it on a server
name: Deploy to Server
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
@romain-trotard
romain-trotard / UnderTheHoodOfReactEventListener.md
Last active March 28, 2024 19:02
Under the hood of event listeners in React

Recently, during the migration to React 17, I had a problem between event listeners handled by React and one added document manually. It was due to this part on the React 17 release note.

At this moment I understood that I had a misconception of how React handles event listener. So I decided to explore the React code to understand how it works.

The misconception

Before going deep in the React codebase, I would like to explain what was in my head about the management of event listeners.

For example when I write this simple code: