The current setup has been tested on Next Js 7.0.0
.
You need to install Axios.
$ npm install axios
import { forEachObjIndexed } from "ramda"; | |
import * as React from "react"; | |
import { | |
Animated, | |
ScrollView, | |
View, | |
ViewStyle, | |
LayoutChangeEvent, | |
NativeScrollEvent, | |
} from "react-native"; |
import React, { useEffect, useRef } from 'react'; | |
/** | |
* Use setInterval with Hooks in a declarative way. | |
* | |
* @see https://stackoverflow.com/a/59274004/3723993 | |
* @see https://overreacted.io/making-setinterval-declarative-with-react-hooks/ | |
*/ | |
export function useInterval( | |
callback: React.EffectCallback, |
const express = require('express'); | |
const app = express(); | |
// Application | |
app.get('/', function(req, res) { | |
if (process.env.NODE_ENV === 'development') { | |
for (var key in require.cache) { | |
delete require.cache[key]; | |
} | |
} |
// we have a LOGOUT action that will reset the whole state | |
// HACK: When state is recreated, it will loose '_persist' in it, and the state will not be persisted anymore. | |
// Dispatching 'persist/REHYDRATE' makes persistence work again somehow, so we dispatch it to all persisted keys. | |
const storageKeys = yield call(storage.getAllKeys); | |
const persistKeys = (storageKeys.map((key: string) => { | |
const regexp = new RegExp('^persist:(.+)'); | |
if (key.match(regexp)) { | |
return RegExp.$1; | |
} |
// Copyright (c) Facebook, Inc. and its affiliates. | |
// This source code is licensed under the MIT license found in the | |
// LICENSE file in the root directory of this source tree. | |
import org.apache.tools.ant.taskdefs.condition.Os | |
def config = project.hasProperty("react") ? project.react : []; | |
def cliPath = config.cliPath ?: "node_modules/react-native/cli.js" |
addTask({ | |
variables: { input }, | |
optimisticResponse: { | |
addTask: { | |
__typename: 'Task', | |
id, | |
...input | |
} | |
}, | |
update: (proxy: any, { data: { addTask } }: any) => { |
import React, { useState, useEffect } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Image, StyleSheet, Dimensions } from 'react-native'; | |
import FastImage from 'react-native-fast-image'; | |
import ImageZoom from 'react-native-image-pan-zoom'; | |
// ZoomableImage component renders a zoomable FastImage the size of the screen dimensions. | |
const dims = Dimensions.get('window'); |
import React from 'react'; | |
import { useStyles } from '../hooks/useStyles'; | |
export const Sidebar = ({ colourful = false }) => { | |
const styles = useStyles(stylesheet); | |
return ( | |
<div className={styles.sidebar}> | |
<p | |
className={styles.compose( |
/* HTTP Function to initialize / reset question counter manually */ | |
const express = require('express'); | |
const cors = require('cors')({ | |
origin: true | |
}); | |
const app = express(); | |
app.use(cors); | |
app.get('/', (req, res) => { | |
const topicID = req.query.topicID, |