Created
March 24, 2016 18:55
-
-
Save timbuckley/a72826072163f19352ce to your computer and use it in GitHub Desktop.
How to export/include a utility function.
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 { percentage } from '../utils.js' | |
// Component goes here. |
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
const width = Dimensions.get('window').width; | |
const height = Dimensions.get('window').height; | |
// Note the export | |
export function percentage(ratio, val) { | |
return Math.round((ratio / 100) * val); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment