Skip to content

Commit 69cc286

Browse files
committed
fix: minify textContent
Shaves off 38 bytes from every bundle
1 parent 33746a0 commit 69cc286

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

packages/react-aria/src/interactions/usePress.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -873,13 +873,7 @@ export function usePress(props: PressHookProps): PressResult {
873873
// touchAction: 'manipulation' is supposed to be equivalent, but in
874874
// Safari it causes onPointerCancel not to fire on scroll.
875875
// https://bugs.webkit.org/show_bug.cgi?id=240917
876-
style.textContent = `
877-
@layer {
878-
[${PRESSABLE_ATTRIBUTE}] {
879-
touch-action: pan-x pan-y pinch-zoom;
880-
}
881-
}
882-
`.trim();
876+
style.textContent=`@layer{[${PRESSABLE_ATTRIBUTE}]{touch-action:pan-x pan-y pinch-zoom}}`
883877
ownerDocument.head.prepend(style);
884878
}, [domRef]);
885879

packages/react-aria/src/overlays/usePreventScroll.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,7 @@ function preventScrollMobileSafari() {
146146
if (nonce) {
147147
style.nonce = nonce;
148148
}
149-
style.textContent = `
150-
@layer {
151-
* {
152-
overscroll-behavior: contain;
153-
}
154-
}`.trim();
149+
style.textContent='@layer{*{overscroll-behavior:contain}}'
155150
document.head.prepend(style);
156151

157152
let onTouchMove = (e: TouchEvent) => {

0 commit comments

Comments
 (0)