UNPKG

@terrastack/ink

Version:

React for CLI. Temporary fork of https://github.com/vadimdemedes/ink

34 lines (28 loc) 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // This component allows developers to render output before main output from all the other components. // The reason it's called <Static> is it's append-only output. Output from <Static> components // is written permantently to stdout and is never updated afterwards. If <Static> component // receives new children, Ink will detect the changes and write them to stdout. // In order for this mechanism to work perfectly, <Static> children must never update their output // once they've been appended to <Static>. // // A good example of where this component might be useful is interface like Jest's. // When running tests, Jest keeps writing completed tests to output, while continuously // rendering test stats at the end of the output. const Static = ({ children }) => _react.default.createElement("div", { static: true }, children); Static.propTypes = { children: _propTypes.default.node }; var _default = Static; exports.default = _default;