List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
| // Global Vars | |
| $basefontsize: 16 !default; | |
| // Mixins | |
| // input pixel value unitless: 8 vs 8px | |
| // ex. @include rem(padding, 8 12 16 24) | |
| @mixin rem($property, $px: $basefontsize) { |
| # EditorConfig helps developers define and maintain consistent | |
| # coding styles between different editors and IDEs | |
| # editorconfig.org | |
| root = true | |
| [*] | |
| end_of_line = lf | |
| charset = utf-8 |
| /** | |
| * Print Stylesheet fuer Deinewebsite.de | |
| * @version 1.0 | |
| * @lastmodified 16.06.2016 | |
| */ | |
| @media print { | |
| /* Inhaltsbreite setzen, Floats und Margins aufheben */ | |
| /* Achtung: Die Klassen und IDs variieren von Theme zu Theme. Hier also eigene Klassen setzen */ |
| "use strict"; | |
| // Load plugins | |
| const autoprefixer = require("autoprefixer"); | |
| const browsersync = require("browser-sync").create(); | |
| const cp = require("child_process"); | |
| const cssnano = require("cssnano"); | |
| const del = require("del"); | |
| const eslint = require("gulp-eslint"); | |
| const gulp = require("gulp"); |
| // Providing Context | |
| // ================== | |
| import React, {useState, useEffect} from "react" | |
| const Context = React.createContext() | |
| function ContextProvider({children}) { | |
| const [allPhotos, setAllPhotos] = useState([]) | |
| const [cartItems, setCartItems] = useState([]) |
I started using React Native in September 2018. I always forget some things when I build new apps, so I'll keep track of the gotchas on this post.
Some topics, such as navigation, will be fundamental to how I think about apps. Others, will be one-line helpers that make apps work more smoothly.
It's gotten to the point where I find my own answers from 6 months before on certain Github issues.
I'll keep adding over time as I think of more. If anyone thinks these topics would be useful, let me know and I'll elaborate.
I have made libraries to address a number of the topics here, from navigation to design.