Skip to content

Instantly share code, notes, and snippets.

@luciaaldana
luciaaldana / date-fns.md
Last active February 15, 2023 10:36
date-fns
@luciaaldana
luciaaldana / alias.md
Last active February 2, 2023 12:25
Absolute path in Vite project React TS (alias)

Absolute path in Vite project React TS (alias)

1) You need to install these packages:

npm i path
yarn add path

npm i @types/node
yarn add @types/node
@luciaaldana
luciaaldana / MapboxGLJSWithReact.md
Last active February 2, 2023 12:27
Mapbox GL JS with React
@luciaaldana
luciaaldana / i18next.md
Last active February 2, 2023 12:28
i18next React

i18next React

Install

npm install react-i18next i18next i18next-browser-languagedetector --save

yarn react-i18next i18next i18next-browser-languagedetector --save
@luciaaldana
luciaaldana / store.md
Last active September 27, 2022 14:40
Config reduxjs/toolkit react-redux

React Redux & Redux Toolkit

React Redux is the official React UI bindings layer for Redux. It lets your React components read data from a Redux store, and dispatch actions to the store to update state.

The Redux Toolkit package is intended to be the standard way to write Redux logic.

npm install @reduxjs/toolkit react-redux
@luciaaldana
luciaaldana / routes.md
Last active February 2, 2023 12:30
Define private and public routes (React-Router v6)

REACT ROUTER DOM V6 - Public and private routes

AppRouter.js:

import React from "react";
import { Routes, Route } from "react-router-dom";
import PrivateRoute from "routes/PrivateRoute";
import PublicRoute from 'routes/PublicRoute';
import { DashboardRoutes } from './DashboardRoutes';
import { PUBLIC_ROUTES, PRIVATE_ROUTES } from 'constants';
@luciaaldana
luciaaldana / keep-the-footer-always-at-the-bottom.html
Last active September 13, 2022 18:47
Keep the footer always at the bottom
@luciaaldana
luciaaldana / vite-testing-config.md
Created September 12, 2022 12:48 — forked from Klerith/vite-testing-config.md
Vite + Testing + Jest - Completo

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto: