Skip to content

Commit ae0968f

Browse files
committed
Example: remove top level code
1 parent 4a65c28 commit ae0968f

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

example/src/App.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ const HighlightPopup = ({
4747
const PRIMARY_PDF_URL = "https://arxiv.org/pdf/1708.08021";
4848
const SECONDARY_PDF_URL = "https://arxiv.org/pdf/1604.02480";
4949

50-
const searchParams = new URLSearchParams(document.location.search);
51-
const initialUrl = searchParams.get("url") || PRIMARY_PDF_URL;
52-
5350
export function App() {
51+
const searchParams = new URLSearchParams(document.location.search);
52+
const initialUrl = searchParams.get("url") || PRIMARY_PDF_URL;
53+
5454
const [url, setUrl] = useState(initialUrl);
5555
const [highlights, setHighlights] = useState<Array<IHighlight>>(
5656
testHighlights[initialUrl] ? [...testHighlights[initialUrl]] : [],
@@ -67,9 +67,7 @@ export function App() {
6767
setHighlights(testHighlights[newUrl] ? [...testHighlights[newUrl]] : []);
6868
};
6969

70-
const scrollViewerTo = useRef((highlight: IHighlight) => {
71-
// Implement scrolling logic here
72-
});
70+
const scrollViewerTo = useRef((highlight: IHighlight) => {});
7371

7472
const scrollToHighlightFromHash = useCallback(() => {
7573
const highlight = getHighlightById(parseIdFromHash());

example/tsconfig.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
2-
"extends": "../tsconfig.json",
3-
"compilerOptions": {
4-
"target": "ESNext",
5-
"module": "ESNext",
6-
"lib": ["ESNext", "DOM"],
7-
"noEmit": true
8-
},
9-
"include": ["./src", "../decs.d.ts"]
2+
"extends": "../tsconfig.json"
103
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"start": "npm run dev",
2424
"dev": "vite build && (cd ./example && vite)",
2525
"build": "npm run clean && npm run compile && vite build && npm run build:example",
26-
"compile": "tsc --noEmit",
26+
"compile": "tsc --noEmit && (cd ./example && tsc --noEmit)",
2727
"build:example": "vite build && (cd ./example && vite build)",
2828
"test": "npm run build && npm run lint && npm run test:e2e",
2929
"test:e2e": "playwright test",

0 commit comments

Comments
 (0)