Show Ionic Framework Docs
Show Create New Project
- ionic start ionic-react-tabs-rc1 tabs --type=react
| // Based on https://www.maxpou.fr/async-await-without-try-catch and https://github.com/DavidWells/safe-await/pull/2/files | |
| export function wrapAsyncFn<T>(somePromise: Promise<T>) { | |
| return somePromise.then((data) => [null, data]).catch((err) => [err, null]); | |
| } | |
| // Based on https://www.youtube.com/watch?v=aIboXjxo-w8 | |
| export async function fetchJson( | |
| input: RequestInfo, | |
| init?: RequestInit | undefined, | |
| ) { |
| #!/usr/bin/python | |
| # | |
| # This script fetches the current open tabs in all Safari windows. | |
| # Useful to run remotely on your mac when you are at work and want | |
| # to read a page you have open (remotely) at home but don't remember | |
| # the url but can log in to your home system on the cmmand line | |
| # | |
| import sys |
| ////////////////////////////////// | |
| // Start useStyles.js | |
| import { useMemo } from "react"; | |
| import styled from "react-native-styled.macro"; | |
| import { useWindowVariant } from "react-native-styled.macro/lib"; | |
| export function useStyles(styleDefinition) { | |
| const variants = useWindowVariant(); |
| import React, { createContext, ReactNode, useMemo, useState } from "react"; | |
| type SwipeContextProps = { | |
| openedItemKey: string; | |
| setOpenedItemKey: (key: string) => void; | |
| }; | |
| type SwipeProviderProps = { | |
| children: ReactNode; | |
| initialOpenedItemKey: string; |
Show Ionic Framework Docs
Show Create New Project
| dist/**/*.js |
| <uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
| # Put this in your `~/.bash_profile` | |
| export ANDROID_HOME=/Users/YOUR_USER_DIRECTORY_HERE/Library/Android/sdk | |
| # NOTE: To use this right away in the same terminal or any | |
| # currently open terminal, you'll need to source it: | |
| > source ~/.bash_profile | |
| # Now, see what emulators you have: |
| import React from 'react' | |
| import { NextContext } from 'next' | |
| // Define what an individual item looks like | |
| interface IDataObject { | |
| id: number, | |
| name: string | |
| } | |
| // Define the props that getInitialProps will inject into the component |
| import { NextFunctionComponent, NextContext } from 'next' | |
| // Define what an individual item looks like | |
| interface IDataObject { | |
| id: number, | |
| name: string | |
| } | |
| // Define the props that getInitialProps will inject into the component | |
| interface IListComponentProps { |