What operating system your computer runs on.
- Mac, Windows, Linux
| // Card data | |
| const cardsArray = [ | |
| { | |
| name: 'shell', | |
| img: 'img/blueshell.png', | |
| }, | |
| { | |
| name: 'star', | |
| img: 'img/star.png', | |
| }, |
| // echo -en "\x01\x02\x03hello" > data | |
| // node read.js data | |
| let fs = require('fs') | |
| let file = process.argv.slice(2)[0] | |
| let buffer = fs.readFileSync(file) | |
| for (let value of buffer) { | |
| let decimal = value | |
| let hex = value.toString(16) |
| const cardsArray = [ /* ... */ ]; | |
| const game = document.getElementById('game'); | |
| const grid = document.createElement('section'); | |
| grid.setAttribute('class', 'grid'); | |
| game.appendChild(grid); | |
| cardsArray.forEach(item => { | |
| const card = document.createElement('div'); | |
| card.classList.add('card'); |
There is no consensus on the right way to organize a React application. React gives you a lot of freedom, but with that freedom comes the responsibility of deciding on your own architecture. Often the case is that whoever sets up the application in the beginning throws almost everything in a components folder, or maybe components and containers if they used Redux, but I propose there's a better way. I like to be deliberate about how I organize my applications so they're easy to use, understand, and extend.
I'm going to show you what I consider to be an intuitive and scalable system for large-scale production React applications. The main concept I think is important is to make the architecture focused on feature as opposed to type, organizing only shared components on a global level and modularized all the other related entities together in the localized view.
Since this article will be opinionated,