30 Jun The third edition of our React newsletter!
Check out the third edition of our React newsletter:
React in the real world
Slack used React to rebuild their Emoji Picker
Packing many features, this complex component was created using react-virtualized. This library supports the loading of huge amounts of data in several presentation formats, while keeping top performance. Pure components were also used, and Storybook was used internally. This kind of example showcases the low impact of adding React to a project.
Absolute import paths in React
A persistent inconvenience while developing medium and large React projects are relative import file paths.
are a common sight, and hinders the ability to move components and alter the file structure without significant effort. This article explains how to add a source path to the .env file, so that import paths can start being absolute, like this:
The explanation is for create-react-app, but it can be implemented in any project with .env files.
Some noteworthy libraries for this edition:
styled-components allows for a different approach in styling components. Through the creation of variables in the component itself, we can define styles that are going to be automatically applied to the component tags, avoiding the mapping between tags and styles.
react-elemap. Naming in React can get tiring, specially if following a convention to avoid name collisions. Events, props and styles names are an example of this. With react-elemap, this naming can be done automatically while following rules you can declare. This way, naming will be consistent throughout the code with little effort.
redux-persist. Sometimes it can be useful to keep the redux state between refreshes. A custom solution can be created for this, but redux-persist allows to persist the state, even providing fine-grain controls to do it in a per reducer basis.
https://github.atom.io/ – Atom added native integration to Github. This allows developers to perform their workflow without leaving Atom. Branches, stages, commits, pull requests, conflict resolution and, of course, pushing and pulling are all supported from within Atom.
https://prepack.io/ – This tool is still on development stage and should not be used in production. Its objective is to improve performance through code optimization. At build time it will detect computations that can be simplified and replaced by optimized code. This enables developers to write code in a clearer and more verbose way, knowing that prepack will optimize unnecessary computations.