Skip to content

Commit

Permalink
Prefix w/ unstable and fix unnecessary assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
devknoll committed Feb 17, 2022
1 parent c538862 commit edc116f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/next/client/streaming/index.ts
@@ -1,3 +1,3 @@
export { useRefreshRoot as unstable_useRefreshRoot } from './refresh'
export { useWebVitalsReport as unstable_useWebVitalsReport } from './vitals'
export { useFlushEffects } from '../../shared/lib/flush-effects'
export { useFlushEffects as unstable_useFlushEffects } from '../../shared/lib/flush-effects'
2 changes: 1 addition & 1 deletion packages/next/shared/lib/flush-effects.ts
Expand Up @@ -13,7 +13,7 @@ export function useFlushEffects(callbacks: Array<() => React.ReactNode>): void {
`\nRead more: https://nextjs.org/docs/messages/client-flush-effects`
)
}
return flushEffectsImpl!(callbacks)
return flushEffectsImpl(callbacks)
}

if (process.env.NODE_ENV !== 'production') {
Expand Down
@@ -1,4 +1,4 @@
import { useFlushEffects } from 'next/streaming'
import { unstable_useFlushEffects } from 'next/streaming'
import React from 'react'

class ErrorBoundary extends React.Component {
Expand All @@ -18,7 +18,7 @@ class ErrorBoundary extends React.Component {
}

function Component() {
useFlushEffects([])
unstable_useFlushEffects([])
return null
}

Expand Down
@@ -1,9 +1,9 @@
import { useFlushEffects } from 'next/streaming'
import { unstable_useFlushEffects } from 'next/streaming'

export default function Custom() {
if (typeof window === 'undefined') {
// eslint-disable-next-line react-hooks/rules-of-hooks
useFlushEffects([
unstable_useFlushEffects([
() => <span id="custom-flush-effect-1">foo</span>,
() => <span id="custom-flush-effect-2">bar</span>,
])
Expand Down
@@ -1,9 +1,9 @@
import { useFlushEffects } from 'next/streaming'
import { unstable_useFlushEffects } from 'next/streaming'

function Component() {
if (typeof window === 'undefined') {
// eslint-disable-next-line react-hooks/rules-of-hooks
useFlushEffects([])
unstable_useFlushEffects([])
}
return null
}
Expand Down

0 comments on commit edc116f

Please sign in to comment.