Blog Logo

Subscribe

RSS
Nested Code

Binding React functions to event handlers

Binding functions from your React components to event handlers is straightforward. Let’s say you want a button in your component to open a new tab/window with a specific URL. That can be easily accomplished with the following: _openWindow: function() { window.open("https://duckduckgo.com", "_blank"); }, render: function() { return…

Welcome to Nested Code!

Hello, my name is Alfonso Mu­ñoz‐Po­mer Fuentes... yes, I know, quite long. That’s why Alf is usually better and shorter. The recurrent A.L.F. joke has also been thrown at me every now and then, but I promise I don’t eat…