Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Not for merge] Perf investigation #4071

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions beta/src/components/Layout/Sidebar/SidebarLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export function SidebarLink({

React.useEffect(() => {
if (ref && ref.current && !!selected && !isMobile) {
scrollIntoView(ref.current, {
scrollMode: 'if-needed',
block: 'center',
inline: 'nearest',
});
// scrollIntoView(ref.current, {
// scrollMode: 'if-needed',
// block: 'center',
// inline: 'nearest',
// });
}
}, [ref, selected, isMobile]);

Expand Down
1 change: 1 addition & 0 deletions beta/src/components/Layout/useTocHighlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export function useTocHighlight() {
const timeoutRef = React.useRef<number | null>(null);

React.useEffect(() => {
return;
function updateActiveLink() {
const pageHeight = document.body.scrollHeight;
const scrollPosition = window.scrollY + window.innerHeight;
Expand Down
2 changes: 1 addition & 1 deletion beta/src/components/MDX/Challenges/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function Navigation({
}, [containerRef, challengesNavRef, scrollPos]);

React.useEffect(() => {
handleResize();
//handleResize();
window.addEventListener('resize', debounce(handleResize, 200));
return () => {
window.removeEventListener('resize', handleResize);
Expand Down
1 change: 1 addition & 0 deletions beta/src/components/MDX/CodeBlock/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const CodeBlock = React.forwardRef(
},
ref?: React.Ref<HTMLDivElement>
) => {
return <pre>lol</pre>
const getDecoratedLineInfo = () => {
if (!metastring) {
return [];
Expand Down
1 change: 1 addition & 0 deletions beta/src/components/MDX/Sandpack/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ul {
`.trim();

function Sandpack(props: SandpackProps) {
return <pre>lol</pre>
let {children, setup, autorun = true} = props;
let [resetKey, setResetKey] = React.useState(0);
let codeSnippets = React.Children.toArray(children) as React.ReactElement[];
Expand Down