Unverified Commit 135642b9 authored by Shu Ding's avatar Shu Ding Committed by GitHub

Remove extra logic of Server Reference check for registering twice (#62486)

This isn't necessary as it has been landed in React already:
https://github.com/facebook/react/pull/28343.

Closes NEXT-2586
parent 4550fadd
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
import { registerServerReference as flightRegisterServerReference } from 'react-server-dom-webpack/server.edge' 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) { export function registerServerReference(id: string, action: any) {
// Avoid registering the same action twice
if (isServerReference(action)) {
return action
}
return flightRegisterServerReference(action, id, null) return flightRegisterServerReference(action, id, null)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment