Refetch the quest on every app state and screen change after 1 minute times up:
useRefetchOnFocus(refetch);
Refetch on every app state and screen change without wait:
useRefetchOnFocus(refetch, 0);
Refetch the quest on every app state and screen change after 1 minute times up:
useRefetchOnFocus(refetch);
Refetch on every app state and screen change without wait:
useRefetchOnFocus(refetch, 0);
import {Dimensions, PixelRatio, StyleSheet} from 'react-native'; | |
const {width, height} = Dimensions.get('window'); | |
const PROPERTIES_DEPENDING_ON_WIDTH = [ | |
'width', | |
'marginLeft', | |
'marginRight', | |
'marginHorizontal', | |
'paddingLeft', |
import {widthPercentageToDP, heightPercentageToDP} from 'react-native-responsive-screen'; | |
const REFERENCE_WIDTH = 428; | |
const REFERENCE_HEIGHT = 926; | |
export const wp = (val: number | string) => { | |
if (typeof val === 'number') { | |
return widthPercentageToDP(`${(100 * val) / REFERENCE_WIDTH}%`); | |
} |
const obj = require("./data.json"); | |
function getUrl(obj) { | |
const ary = []; | |
helper(obj, ary); | |
return ary; | |
} | |
function helper(item, ary) { | |
if (typeof item === "string" && isUrl(item)) { |
Use python3
.
python3 bin2png <binary> <destination>
# example -> python3 bin2png testbin .
The package linked to from here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.