Skip to content

Instantly share code, notes, and snippets.

View bbernag's full-sized avatar
🎯
Focusing

berna bbernag

🎯
Focusing
  • Monterrey, N.L.
  • 03:03 (UTC -06:00)
View GitHub Profile
@sebmarkbage
sebmarkbage / WhyReact.md
Created September 4, 2019 20:33
Why is React doing this?

I heard some points of criticism to how React deals with reactivity and it's focus on "purity". It's interesting because there are really two approaches evolving. There's a mutable + change tracking approach and there's an immutability + referential equality testing approach. It's difficult to mix and match them when you build new features on top. So that's why React has been pushing a bit harder on immutability lately to be able to build on top of it. Both have various tradeoffs but others are doing good research in other areas, so we've decided to focus on this direction and see where it leads us.

I did want to address a few points that I didn't see get enough consideration around the tradeoffs. So here's a small brain dump.

"Compiled output results in smaller apps" - E.g. Svelte apps start smaller but the compiler output is 3-4x larger per component than the equivalent VDOM approach. This is mostly due to the code that is usually shared in the VDOM "VM" needs to be inlined into each component. The tr

@bradtraversy
bradtraversy / eslint_prettier_airbnb.md
Created July 19, 2019 17:54
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@parties
parties / renameReactJsToJsx.sh
Last active July 29, 2025 15:44
rename all *.js files containing React markup to *.jsx
# finds all *.js files that have either `</` or `/>` tags in them and renames them to *.jsx
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l -E "</|/>" "$0"' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \;
# Insomnia Configuration
## Run the test query
{
shop {
id
name
}
}
# Query Structure Examples
@goodpic
goodpic / ProductScanRNCamera.js
Last active April 24, 2023 11:54
RNCamera : Use the barcode scanner on React Native
import React, { Component } from 'react';
import { Button, Text, View } from 'react-native';
import { RNCamera } from 'react-native-camera';
class ProductScanRNCamera extends Component {
constructor(props) {
super(props);
this.camera = null;
this.barcodeCodes = [];
@VinayakBagaria
VinayakBagaria / .editorconfig
Last active January 8, 2024 15:23
Prettier, ESLint, Husky, Lint-Staged, Editorconfig for React (Web/Native)
# look for an .editorconfig file inside this project
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
# while saving
insert_final_newline = true

Libraries and Tools for React

If you're developing an application based on React it can be helpful if you don't need to develop all the basic UI components yourself. Here you can find a list with various components, component libraries and complete design systems developed with and for React.

As the list got longer and longer I thought it would be better to have a "real" site for it.

👉 Please find the (new) list here: https://react-libs.nilshartmann.net/

@spemer
spemer / customize-scrollbar.css
Last active May 16, 2025 20:21
✨ Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */
/* total width */
body::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}
/* background of the scrollbar except button or resizer */
@sudomabider
sudomabider / _helper.scss
Created May 8, 2017 22:14
commonly used sass spacing helpers (bootstrap-4 style)
@mixin margin-helper($level, $spacing) {
.m-#{$level} {margin: #{$spacing}!important;}
.mx-#{$level} {margin-left: #{$spacing}!important;margin-right: #{$spacing}!important;}
.my-#{$level} {margin-top: #{$spacing}!important;margin-bottom: #{$spacing}!important;}
.mt-#{$level} {margin-top: #{$spacing}!important;}
.mb-#{$level} {margin-bottom: #{$spacing}!important;}
.ml-#{$level} {margin-left: #{$spacing}!important;}
.mr-#{$level} {margin-right: #{$spacing}!important;}
}
@JamieMason
JamieMason / es6-compose.md
Last active May 17, 2022 17:38
ES6 JavaScript compose function

ES6 JavaScript Compose Function

Definition

const compose = (...fns) =>
  fns.reduceRight((prevFn, nextFn) =>
    (...args) => nextFn(prevFn(...args)),
    value => value
 );