Skip to content

Commit 6e04514

Browse files
committed
chore(miscellaneous): update demo flags from js to ts
1 parent 5eea04c commit 6e04514

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/react-core/src/demos/DateTimePicker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ In this demo, learn how to use a [CalendarMonth](/components/date-and-time/calen
2020

2121
### Date and time range picker
2222

23-
```ts file ="examples/DateTimePicker/DateTimeRangePicker.tsx"
23+
```ts file="examples/DateTimePicker/DateTimeRangePicker.tsx"
2424

2525
```

packages/react-core/src/demos/examples/JumpLinks/JumpLinksScrollspy.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ export const JumpLinksScrollspy: React.FunctionComponent = () => {
2121
const [isVertical, setIsVertical] = useState(true);
2222
const [offsetHeight, setOffsetHeight] = useState(10);
2323
const offsetForPadding = 10;
24-
let masthead;
2524

2625
// Update offset based on the masthead and jump links nav heights.
2726
useEffect(() => {
28-
masthead = document.getElementsByClassName(mastheadStyles.masthead)[0];
27+
const masthead = document.getElementsByClassName(mastheadStyles.masthead)[0];
2928

3029
if (isVertical) {
3130
setOffsetHeight(masthead.offsetHeight + offsetForPadding);
@@ -35,7 +34,7 @@ export const JumpLinksScrollspy: React.FunctionComponent = () => {
3534
jumpLinksHeaderHeight && setOffsetHeight(masthead.offsetHeight + jumpLinksHeaderHeight + offsetForPadding);
3635
}
3736

38-
getResizeObserver(
37+
const observer = getResizeObserver(
3938
document.getElementsByClassName(mastheadStyles.masthead)[0],
4039
() => {
4140
if (isVertical) {
@@ -48,6 +47,8 @@ export const JumpLinksScrollspy: React.FunctionComponent = () => {
4847
},
4948
true
5049
);
50+
51+
return () => observer();
5152
}, [isVertical]);
5253

5354
return (

0 commit comments

Comments
 (0)