Skip to content

Commit

Permalink
Remove extra logic of Server Reference check for registering twice (#…
Browse files Browse the repository at this point in the history
…62486)

This isn't necessary as it has been landed in React already:
facebook/react#28343.

Closes NEXT-2586
  • Loading branch information
shuding authored Mar 5, 2024
1 parent 4550fad commit 135642b
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
import { registerServerReference as flightRegisterServerReference } from 'react-server-dom-webpack/server.edge'

const SERVER_REFERENCE_TAG = Symbol.for('react.server.reference')

function isServerReference(reference: any) {
return reference && reference.$$typeof === SERVER_REFERENCE_TAG
}

export function registerServerReference(id: string, action: any) {
// Avoid registering the same action twice
if (isServerReference(action)) {
return action
}

return flightRegisterServerReference(action, id, null)
}

0 comments on commit 135642b

Please sign in to comment.