import React from 'react';
export function reactGetTextContent(rootReactNode) {
    var result = '';
    var getText = function (reactNode) {
        if (typeof reactNode === 'string' || typeof reactNode === 'number') {
            result += reactNode.toString();
        }
        else if (Array.isArray(reactNode)) {
            reactNode.forEach(function (node) { return getText(node); });
        }
        else if (React.isValidElement(reactNode) &&
            reactNode.props &&
            typeof reactNode.props === 'object' &&
            'children' in reactNode.props) {
            var children = reactNode.props.children;
            getText(children);
        }
    };
    getText(rootReactNode);
    return result;
}
//# sourceMappingURL=reactGetTextContent.js.map