mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-29 05:41:46 +02:00
Fix no-base-to-string
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user