MCPcopy
hub / github.com/nygardk/react-share / hasTextContent

Function hasTextContent

src/ShareButton.tsx:74–90  ·  view source on GitHub ↗
(children: React.ReactNode)

Source from the content-addressed store, hash-verified

72}
73
74function hasTextContent(children: React.ReactNode): boolean {
75 return Children.toArray(children).some(child => {
76 if (typeof child === 'string') {
77 return child.trim().length > 0;
78 }
79
80 if (typeof child === 'number') {
81 return true;
82 }
83
84 if (!isValidElement<{ children?: React.ReactNode }>(child)) {
85 return false;
86 }
87
88 return hasTextContent(child.props.children);
89 });
90}
91
92function windowOpen(
93 url: string,

Callers 1

ShareButtonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…