Skip to content

Commit

Permalink
add React.cache test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Sep 19, 2023
1 parent 8c09649 commit 2251d4e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react'
import { clientRef } from './client-component'

export const contentType = 'image/png'
const cachedNoop = React.cache(() => null)

function noopCall(value) {
return value
Expand All @@ -9,5 +11,6 @@ function noopCall(value) {
export default function sitemap() {
// keep the variable from being tree-shaken
noopCall(clientRef)
cachedNoop()
return []
}

0 comments on commit 2251d4e

Please sign in to comment.