Callback refs as componentDidMount in stateless functions in React

Web development

You might think that when developing user interfaces with React and if you want to e.g. apply jQuery method to an element, you must abandon your beloved stateless function in favor of class-based component, directly or indirectly via higher-order components, because stateless function doesn’t have componentDidMount life-cycle hook. You are wrong, you can use callback…

Reactive React component using MobX (counter example)

Coding, Web development

In the following (muted) video for beginners I show how simple it is to make a React component reactive using MobX. Component displays counter’s value and buttons for incrementing and decrementing it and when user clicks the buttons, value is updated on screen accordingly. The main takeaway from this example is this: when observable variables…

Developing web applications with React and its ecosystem

Web development

React with its component-based approach is fun! But you can find it hard to build web application with it. That’s because React is not a framework. It’s a library which does one part of building web applications, rendering views, and does it well. You need to bring in other libraries (ecosystem) and piece them together…