Skip to content

Instantly share code, notes, and snippets.

View theandersonn's full-sized avatar
👉
Silence is Golden

theandersonn

👉
Silence is Golden
  • americanas s.a.
  • Rio de Janeiro, Brazil
View GitHub Profile
@theandersonn
theandersonn / index.jsx
Last active April 25, 2021 16:07
Component Tooltip
// Reference (Thanks!)
// https://dev.to/vtrpldn/how-to-make-an-extremely-reusable-tooltip-component-with-react-and-nothing-else-3pnk
import { useState } from 'react'
import PropTypes from 'prop-types'
import * as S from './styles'
const Tooltip = ({ delay, children, direction, content }) => {
let timeout
@theandersonn
theandersonn / gist:04f7d5fb65f58280d317132eef3b68ae
Last active April 24, 2021 21:40
Configurar importações absolutas no Create React App
  1. Crie o arquivo jsconfig.json na raiz do projeto e insira a configuração abaixo.
{
  "compilerOptions": {
    "baseUrl": "src"
  }
}
@theandersonn
theandersonn / renderizacao-componentes-react.md
Created May 15, 2020 02:05
Renderização de componentes no React

React.createClass()

Está depreciado desde a versão 15.5

Funções puras

Sempre deve retornar os mesmos valores, sempre que passar os mesmos parametros. Não deve modificar nada externo na aplicação e nem depender dos parametros que estão sendo passados.

import React from "react";
@theandersonn
theandersonn / .config
Created April 23, 2020 10:25
Color-Scheme (terminator)
[global_config]
[keybindings]
[layouts]
[[default]]
[[[child1]]]
parent = window0
type = Terminal
[[[window0]]]
parent = ""
type = Window
# editorconfig.org
root = true
[*]
indent_style = spaces
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
{
"editor.minimap.enabled": false,
"editor.autoClosingBrackets": "always",
"editor.fontFamily": "Fira Code",
"editor.fontSize": 16,
"editor.lineHeight": 24,
"editor.fontLigatures": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.parameterHints.enabled": false,