This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useRouter } from "next/router"; | |
| import { ParsedUrlQuery } from "querystring"; | |
| interface UseRouterParamsOptions { | |
| method?: "push" | "replace"; | |
| shallow?: boolean; | |
| } | |
| const useRouterParams = (options?: UseRouterParamsOptions) => { | |
| const { query, pathname, push, replace } = useRouter(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .styleguide-frame { | |
| position: relative; | |
| transform: translate3d(0, 0, 0); /* <-- THIS LINE MAKES THE TRICK! */ | |
| outline: 1px solid #eaeaea; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { StyleSheet, Text, View } from 'react-native'; | |
| import { BarCodeScanner } from 'expo'; | |
| export default class App extends React.Component { | |
| render() { | |
| return ( | |
| <BarCodeScanner | |
| onBarCodeRead={(scan) => alert(scan.data)} | |
| style={[StyleSheet.absoluteFill, styles.container]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| axios({ | |
| url: 'http://localhost:5000/static/example.pdf', | |
| method: 'GET', | |
| responseType: 'blob', // important | |
| }).then((response) => { | |
| const url = window.URL.createObjectURL(new Blob([response.data])); | |
| const link = document.createElement('a'); | |
| link.href = url; | |
| link.setAttribute('download', 'file.pdf'); | |
| document.body.appendChild(link); |