This PR adds the first component, a simple Button. The structure of the Button.js file is a new one for me, using the function syntax to create a function component. One thing to note is that I am not using the .jsx extension. React knows what it's rendering, I prefer the cleaner folder. In the folder is also a README with a somewhat detailed code example. In the future READMEs should have details on the props and whatnot they interact with.
The index.js files in the src and components folders are now set to export the components. src exports them all blindly, but components is an explicit export. This architecture is meant to be easy to scale later, and tools like Generact make it easy to duplicate this elaborate folder structure.
I also moved the babel config out from the webpack config to its own .babelrc after adding the React preset.
Changes
This PR adds the first component, a simple Button. The structure of the Button.js file is a new one for me, using the
function
syntax to create a function component. One thing to note is that I am not using the.jsx
extension. React knows what it's rendering, I prefer the cleaner folder. In the folder is also a README with a somewhat detailed code example. In the future READMEs should have details on the props and whatnot they interact with.The index.js files in the src and components folders are now set to export the components.
src
exports them all blindly, butcomponents
is an explicit export. This architecture is meant to be easy to scale later, and tools like Generact make it easy to duplicate this elaborate folder structure.I also moved the babel config out from the webpack config to its own
.babelrc
after adding the React preset.What do
Fixes #3