diff options
author | 2023-07-03 05:59:43 -0700 | |
---|---|---|
committer | 2023-07-03 20:59:43 +0800 | |
commit | 2fea174303ca60f4765c6294d99ebc7a19e73403 (patch) | |
tree | 671f1f27d6d0827e51aaa20704b7f6154ad5d053 /packages/integrations/react/server.js | |
parent | fc6826ff7620b0c5e419de93ef7c463a12fe3652 (diff) | |
download | astro-2fea174303ca60f4765c6294d99ebc7a19e73403.tar.gz astro-2fea174303ca60f4765c6294d99ebc7a19e73403.tar.zst astro-2fea174303ca60f4765c6294d99ebc7a19e73403.zip |
feat: use typescript-eslint@v6's reworked configs (#7425)
Diffstat (limited to 'packages/integrations/react/server.js')
-rw-r--r-- | packages/integrations/react/server.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/integrations/react/server.js b/packages/integrations/react/server.js index b6829e338..8c02c4b26 100644 --- a/packages/integrations/react/server.js +++ b/packages/integrations/react/server.js @@ -18,8 +18,7 @@ async function check(Component, props, children) { // Note: there are packages that do some unholy things to create "components". // Checking the $$typeof property catches most of these patterns. if (typeof Component === 'object') { - const $$typeof = Component['$$typeof']; - return $$typeof && $$typeof.toString().slice('Symbol('.length).startsWith('react'); + return Component['$$typeof'].toString().slice('Symbol('.length).startsWith('react'); } if (typeof Component !== 'function') return false; @@ -97,7 +96,7 @@ async function renderToStaticMarkup(Component, props, { default: children, ...sl identifierPrefix: prefix, }; let html; - if (metadata && metadata.hydrate) { + if (metadata?.hydrate) { if ('renderToReadableStream' in ReactDOM) { html = await renderToReadableStreamAsync(vnode, renderOptions); } else { |