MCPcopy
hub / github.com/react/react / constructor

Method constructor

packages/react-art/src/ReactART.js:148–159  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

146
147class 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;

Callers

nothing calls this directly

Calls 1

forEachMethod · 0.65

Tested by

no test coverage detected