This file contains 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 * as React from "react" | |
import { useState, useEffect } from "react" | |
// Hook | |
let cachedScripts = [] | |
export function useScript(src) { | |
// Keeping track of script loaded and error state | |
const [state, setState] = useState({ | |
loaded: false, |
This file contains 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 * as React from "react"; | |
/** | |
A hook to simply use state between components | |
Warning: this only works with function components (like any hook) | |
Usage: | |
// You can put this in an central file and import it too | |
const useStore = createStore({ count: 0 }) |
This file contains 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 { Data, animate, Override, Animatable } from "framer"; | |
const data = Data({ scaleValues: [] }); | |
export const Scale: Override = props => { | |
data.scaleValues.push({ id: props.id, scaleValue: Animatable(1) }); | |
return { | |
scale: getValueForId(props.id), | |
onTap() { | |
let valueToScale = getValueForId(props.id); |