-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package exports now used to select between node and browser bundles (#…
…156) Package exports now used to select between node (server-rendering) and browser (client-rendering) bundles
- Loading branch information
Showing
7 changed files
with
35 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const isBrowser = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const isBrowser = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const isBrowser = typeof window !== "undefined"; |
11 changes: 2 additions & 9 deletions
11
packages/react-resizable-panels/src/hooks/useIsomorphicEffect.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
import { isBrowser } from "#is-browser"; | ||
import { useLayoutEffect } from "../vendor/react"; | ||
|
||
const canUseEffectHooks = !!( | ||
typeof window !== "undefined" && | ||
typeof window.document !== "undefined" && | ||
typeof window.document.createElement !== "undefined" | ||
); | ||
|
||
const useIsomorphicLayoutEffect = canUseEffectHooks | ||
? useLayoutEffect | ||
: () => {}; | ||
const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : () => {}; | ||
|
||
export default useIsomorphicLayoutEffect; |
This file was deleted.
Oops, something went wrong.
e0c082a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-resizable-panels – ./
react-resizable-panels.vercel.app
react-resizable-panels-bvaughn.vercel.app
react-resizable-panels-git-main-bvaughn.vercel.app