Skip to content

Instantly share code, notes, and snippets.

@tannerlinsley
tannerlinsley / README.md
Last active April 12, 2024 17:04
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

import React from 'react';
import {View, Dimensions} from 'react-native';
import Animated, {
useAnimatedScrollHandler,
useAnimatedStyle,
useSharedValue,
} from 'react-native-reanimated';
const BORDER_RADIUS = 10;
@slorber
slorber / README.md
Last active January 18, 2023 09:48
React Hebdo 2020

Je teste un système de "petites annonces". Le même Gist sera utilisé sur plusieurs éditions.

Mettez un commentaire:

  • si vous recrutez
  • si vous cherchez un travail ou une mission
  • pour commenter un article
  • pour donner votre avis sur la newsletter
@slorber
slorber / react-navigation-tree.jsx
Last active August 13, 2022 19:17
react-navigation-tree.jsx
const App = createAppContainer(
createStack({
LoggedSwitch: createSwitch({
// When user is authenticated
LoggedIn: createStack({
// The logged in root is generally a tab or drawer navigator
LoggedInRoot: createTabsOrDrawer({
@alfonmga
alfonmga / apollo-refreshToken-link.js
Last active September 5, 2023 22:29
Apollo refresh auth token link. It tries to refresh the user access token on the fly when API throws out an UNAUTHENTICATED error. If multiple requests fail at the same time, it queues them to re-try them later if we are able to get a new access token, otherwise we log out the user and redirect him to the login page.
// sequential
function App() {
let one = Resource.read('1')
let two = Resource.read('2')
let three = Resource.read('3')
return (
<div>
<div>{one}</div>
<div>{two}</div>
<div>{three}</div>
@sixeyed
sixeyed / profile.ps1
Created November 1, 2018 11:25
PowerShell profile with a Linux-style prompt and aliases for common Docker commands
function Prompt(){
$W = Split-Path -leaf -path (Get-Location)
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green
$prompt += Write-Prompt $W -ForegroundColor DarkCyan
$prompt += Write-Prompt '>'
return ' '
}
function Remove-StoppedContainers {
docker container rm $(docker container ls -q)
@AlexBrasileiro
AlexBrasileiro / index.js
Last active September 24, 2020 21:46
ShareYourFeedback
// inspiration: https://dribbble.com/shots/4370657-Share-Your-Feedback
import React, { Component, Fragment } from "react";
import { Animated, StyleSheet, Text, View, TouchableOpacity, Dimensions, Platform, Easing, TextInput, KeyboardAvoidingView, Image } from "react-native";
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
const { width: windowWidth } = Dimensions.get('window');
const Icon = (props) => <FontAwesome5 {...props} />
@matteocollina
matteocollina / beta_lane.sh
Last active February 5, 2020 13:57
Beta lane - Fastlane (ad-hoc)
platform :ios do
desc "This is beta lane"
lane :beta do
get_provisioning_profile(
adhoc: true,
force: true
)
increment_build_number
gym(export_method:"ad-hoc",
scheme: "Golee",
@ebidel
ebidel / coverage.js
Last active April 27, 2024 04:13
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples