From bccc5b2d52e6bb2a237ee46e607f9e287c594cad Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Mon, 24 Nov 2025 17:22:34 -0500 Subject: [PATCH] Avoid `no-use-before-define` lint suppressions by rearranging declarations. (#3225) By moving `styles` higher up in the file, we can remove the suppressions. --- src/components/ShareSheet/ShareSheet.tsx | 50 ++++++++++++------------ 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/src/components/ShareSheet/ShareSheet.tsx b/src/components/ShareSheet/ShareSheet.tsx index aefb008e0..07cc9bd7f 100644 --- a/src/components/ShareSheet/ShareSheet.tsx +++ b/src/components/ShareSheet/ShareSheet.tsx @@ -13,9 +13,32 @@ interface ButtonProps { style?: object; } +const styles = StyleSheet.create( { + button: { + fontSize: 16, + margin: 16 + }, + container: { + flex: 1, + backgroundColor: "white" + }, + text: { + fontSize: 20, + textAlign: "center", + margin: 16 + }, + buttonGroup: { + flexDirection: "row", + justifyContent: "space-around", + alignItems: "center" + }, + destructive: { + color: "red" + } +} ); + const Button = ( { onPress, title, style }: ButtonProps ) => ( - {/* eslint-disable-next-line no-use-before-define */} {title} ); @@ -32,7 +55,6 @@ const ShareSheet = () => { const { container, text, buttonGroup, destructive - // eslint-disable-next-line no-use-before-define } = styles; return ( @@ -59,28 +81,4 @@ const ShareSheet = () => { ); }; -const styles = StyleSheet.create( { - button: { - fontSize: 16, - margin: 16 - }, - container: { - flex: 1, - backgroundColor: "white" - }, - text: { - fontSize: 20, - textAlign: "center", - margin: 16 - }, - buttonGroup: { - flexDirection: "row", - justifyContent: "space-around", - alignItems: "center" - }, - destructive: { - color: "red" - } -} ); - export default ShareSheet;