How to use the react-sketchapp.StyleSheet.flatten function in react-sketchapp

To help you get started, we’ve selected a few react-sketchapp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lelandrichardson / react-primitives / src / injection / react-sketchapp.js View on Github external
const ReactPrimitives = require('../ReactPrimitives');
const Animated = require('animated');
const Easing = require('animated/lib/Easing');
const {
  View,
  Text,
  Image,
  StyleSheet,
  // TODO(lmr): Dimensions
} = require('react-sketchapp');

Animated.inject.FlattenStyle(StyleSheet.flatten);

ReactPrimitives.inject({
  StyleSheet,
  View,
  Text,
  Image,
  Easing,
  Animated: {
    ...Animated,
    View: Animated.createAnimatedComponent(View),
    Text: Animated.createAnimatedComponent(Text),
    Image: Animated.createAnimatedComponent(Image),
  },
  Platform: {
    OS: 'sketch',
    Version: 1,