(props)
| 146 | |
| 147 | class Text extends React.Component { |
| 148 | constructor(props) { |
| 149 | super(props); |
| 150 | // We allow reading these props. Ideally we could expose the Text node as |
| 151 | // ref directly. |
| 152 | ['height', 'width', 'x', 'y'].forEach(key => { |
| 153 | Object.defineProperty(this, key, { |
| 154 | get: function () { |
| 155 | return this._text ? this._text[key] : undefined; |
| 156 | }, |
| 157 | }); |
| 158 | }); |
| 159 | } |
| 160 | render() { |
| 161 | // This means you can't have children that render into strings... |
| 162 | const T = TYPES.TEXT; |