Fix no-base-to-string

This commit is contained in:
Gregory Schier
2026-03-13 07:48:50 -07:00
parent e4103f1a4a
commit be34dfe74a
11 changed files with 14 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ import type { ReactNode } from 'react';
* https://stackoverflow.com/questions/50428910/get-text-content-from-node-in-react
*/
export function getNodeText(node: ReactNode): string {
if (['string', 'number'].includes(typeof node)) {
if (typeof node === 'string' || typeof node === 'number') {
return String(node);
}