This file contains hidden or 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
| diff --git a/src/IncrementalBundler.js b/src/IncrementalBundler.js | |
| index d08a90fa6f12816cb799746b493d438074b6df65..3ec78ba7b039965e9f14496fae0ce3089ee71acd 100644 | |
| --- a/src/IncrementalBundler.js | |
| +++ b/src/IncrementalBundler.js | |
| @@ -70,8 +70,7 @@ class IncrementalBundler { | |
| lazy: otherOptions.lazy, | |
| unstable_allowRequireContext: | |
| this._config.transformer.unstable_allowRequireContext, | |
| - unstable_enablePackageExports: | |
| - this._config.resolver.unstable_enablePackageExports, |
This file contains hidden or 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
| function usePrefetch() { | |
| return useQuery("A", () => fetchA()); | |
| } | |
| function InnerA({isLoading, data}: ReturnType<typeof usePrefetch>) { | |
| useEffect(() => { | |
| if (data) sendEvent('fetchA', data); | |
| }, [data]); | |
| if (isLoading) return <p>Loading</p>; | |
| return <div> {data} <B /> </div>; |
This file contains hidden or 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
| import { useQuery } from "react-query"; | |
| import { Route, Routes } from "react-router-dom"; | |
| import { Link, PrefetchRouter, useIsPrefetch } from "react-prefetching"; | |
| export default function App() { | |
| return ( | |
| <PrefetchRouter> // <- 1. replace BrowserRouter | |
| <Routes> | |
| <Link to="/a">A</Link> // <- 2. use Link from prefetch | |
| <Route path="a" element={<A />} /> |
This file contains hidden or 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
| import { useQuery } from "react-query"; | |
| import { BrowserRouter, Link, Route, Routes } from "react-router-dom"; | |
| export default function App() { | |
| return ( | |
| <BrowserRouter> | |
| <Routes> | |
| <Link to="/a">A</Link> | |
| <Route path="a" element={<A />} /> | |
| </Routes> |
This file contains hidden or 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
| import { withStable } from "react-with-stable"; | |
| import { useEffect } from "react-better-effect"; | |
| function App({ movie }) { | |
| const [uppercase, setUppercase] = useState(false); | |
| const format = useCallback((str) => { | |
| return uppercase ? str.toUpperCase() : str; | |
| }, [uppercase]); | |
| useSyncTitle(format, movie); |
This file contains hidden or 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
| function App({ movie }) { | |
| const [uppercase, setUppercase] = useState(false); | |
| const format = useCallback((str) => { | |
| return uppercase ? str.toUpperCase() : str; | |
| }, [uppercase]); | |
| useSyncTitle(format, movie); | |
| useShowRating(format, movie); | |
| return ( |
This file contains hidden or 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
| function Chat({ selectedRoom }) { | |
| const theme = useContext(ThemeContext); | |
| useEffect(($) => { | |
| const socket = createSocket('/chat/' + selectedRoom); | |
| socket.on('connected', async () => { | |
| showToast($.theme, 'Checking connection to ' + connectedRoom); | |
| await checkConnection(selectedRoom); | |
| showToast($.theme, 'Connected to ' + connectedRoom); |
This file contains hidden or 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
| function Note() { | |
| const [text, setText] = useState(''); | |
| useEffect(($) => { | |
| let count = 0; | |
| const id = setInterval(() => { | |
| count += 1; // 😚 Just modify count | |
| saveDraft($.text, count); | |
NewerOlder