diff --git a/try.js b/try.js index c2119d6..545ea87 100644 --- a/try.js +++ b/try.js @@ -5,19 +5,19 @@ * LICENSE file in the root directory of this source tree. */ -import * as React from "react"; -import ReactVersion from "shared/ReactVersion"; -import { LegacyRoot } from "react-reconciler/src/ReactRootTags"; +import * as React from 'react'; +import ReactVersion from 'shared/ReactVersion'; +import {LegacyRoot} from 'react-reconciler/src/ReactRootTags'; import { createContainer, updateContainer, injectIntoDevTools, -} from "react-reconciler/src/ReactFiberReconciler"; -import Transform from "art/core/transform"; -import Mode from "art/modes/current"; -import FastNoSideEffects from "art/modes/fast-noSideEffects"; +} from 'react-reconciler/src/ReactFiberReconciler'; +import Transform from 'art/core/transform'; +import Mode from 'art/modes/current'; +import FastNoSideEffects from 'art/modes/fast-noSideEffects'; -import { TYPES, childrenAsString } from "./ReactARTInternals"; +import {TYPES, childrenAsString} from './ReactARTInternals'; Mode.setCurrent( // Change to 'art/modes/dom' for easier debugging via SVG @@ -62,7 +62,7 @@ class Pattern { class Surface extends React.Component { componentDidMount() { - const { height, width } = this.props; + const {height, width} = this.props; this._surface = Mode.Surface(+width, +height, this._tagRef); @@ -72,7 +72,7 @@ class Surface extends React.Component { null, false, false, - "", + '', ); updateContainer(this.props.children, this._mountNode, this); } @@ -107,7 +107,7 @@ class Surface extends React.Component { return ( (this._tagRef = ref)} + ref={ref => (this._tagRef = ref)} accessKey={props.accessKey} className={props.className} draggable={props.draggable} @@ -125,7 +125,7 @@ class Text extends React.Component { super(props); // We allow reading these props. Ideally we could expose the Text node as // ref directly. - ["height", "width", "x", "y"].forEach((key) => { + ['height', 'width', 'x', 'y'].forEach(key => { Object.defineProperty(this, key, { get: function () { return this._text ? this._text[key] : undefined; @@ -137,24 +137,33 @@ class Text extends React.Component { // This means you can't have children that render into strings... const T = TYPES.TEXT; return ( - (this._text = t)}> + (this._text = t)}> {childrenAsString(this.props.children)} ); } -} + } injectIntoDevTools({ findFiberByHostInstance: () => null, bundleType: __DEV__ ? 1 : 0, version: ReactVersion, - rendererPackageName: "react-art", + rendererPackageName: 'react-art', }); /** API */ + + + + + + + + + export const ClippingRectangle = TYPES.CLIPPING_RECTANGLE; export const Group = TYPES.GROUP; export const Shape = TYPES.SHAPE; export const Path = Mode.Path; -export { LinearGradient, Pattern, RadialGradient, Surface, Text, Transform }; +export {LinearGradient, Pattern, RadialGradient, Surface, Text, Transform}; \ No newline at end of file