I made my first React Component! ⚛️
I made my first React Component! ⚛️

I made my first React Component! ⚛️

Tags
Coding
Learning
React
Published
Published on October 15, 2017
I created a Grid Component.
It accepts an array of arrays in order to structure the cells inside of it, and it automatically resizes to be as big or as small as I need it to be. The cells can contain anything, even other grids!
This is what using the grid looks like in React:
<Grid cells={THE_ARRAY_OF_CELLS_GOES_HERE}/>
It outputs a table, which is great because coding what you see below by hand in HTML is the very definition of hell 🔥.
(yes it’s hideous 😉 … there’s no CSS in it yet!)
notion image
UPDATE:
This was awful to style because tables kind of suck, so I stopped trying and came up with something else.I made another version of it using divs and Flexbox in the end, and it’s actually beautiful!