Image for post
Image for post
Photo by CHUTTERSNAP on Unsplash

Disclaimer: I predominantly work with React, so the opinions in this article are mainly drawn from that experience. It may or may not be less relevant in other contexts.

With ES modules, there are 2 ways to export a module: default exports, and named exports.

As a quick reminder, a default export looks something like this:

export default () => <button>...</button>

or:

const Button = () => <button>...</button>export default Button

And a named export looks something like:

export const Button = () => <button>...</button>

or:

const Button = () => <button>...</button>export { Button }

I’ve often wondered in which scenarios it makes sense to use default exports, and when I should rather opt for a named export. I have traditionally taken the approach of using a default export where possible, and supplementing with named exports as necessary, e.g. when exporting multiple items from a single module. This probably mostly stems from having encountered the import/prefer-default-export ESLint rule which is notably included in the popular Airbnb JavaScript style guide and ESLint config. …


Image for post
Image for post
Photo by Émile Perron on Unsplash

Setting up your own React project from scratch can seem daunting if you’ve never done it before, but I want to show you how quick and easy it can be to get a basic project set up with everything you need to start writing your next React app.

Facebook’s create-react-app is an extremely convenient way to quickly get a boilerplate React project set up, but I find it comes with a lot of packages and configuration that I don’t always need, and I prefer to have a little more fine-grained control over my setup. …


Visual Studio Code has become increasingly popular over the past couple of years, reaching 1st place in the 2019 Stack Overflow Developer Survey with 50.7% of respondents choosing it as their favorite development environment. I have been using it for about a year now and have never looked back. It’s highly customizable, has third-party extensions for just about anything, and comes with a ton of great presets and built-in features (like Emmet) that each make your life as a developer just that little bit sweeter.

Below (in no particular order) are 5 of my favorite VS Code extensions, with links to each and a brief description. …

About

Sean Baines

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