From 073bdbdc68b4f35a919892c495cd7d48c0c873ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:09:45 +0000 Subject: [PATCH 1/5] Initial plan for issue From af5d124a89925c199e69810e860e3cc00ce795f1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:18:34 +0000 Subject: [PATCH 2/5] Add dynamic Button examples and functional tests for fast refresh Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com> --- .../js/examples/Button/ButtonExample.js | 135 ++++++++++++++++++ .../test/ButtonComponentTest.test.ts | 89 ++++++++++++ 2 files changed, 224 insertions(+) diff --git a/packages/@react-native/tester/js/examples/Button/ButtonExample.js b/packages/@react-native/tester/js/examples/Button/ButtonExample.js index 332f9cd6669..60f388eb208 100644 --- a/packages/@react-native/tester/js/examples/Button/ButtonExample.js +++ b/packages/@react-native/tester/js/examples/Button/ButtonExample.js @@ -221,11 +221,146 @@ exports.examples = [ ); }, }, + { + title: 'Button with dynamic text', + description: 'Button text updates when pressed', + render: function (): React.Node { + return ; + }, + }, + { + title: 'Button with dynamic color', + description: 'Button color updates when pressed', + render: function (): React.Node { + return ; + }, + }, + { + title: 'Button with dynamic disabled state', + description: 'Button disabled state toggles when pressed', + render: function (): React.Node { + return ; + }, + }, + { + title: 'Button with dynamic styling on press', + description: 'Button updates styling when pressed', + render: function (): React.Node { + return ; + }, + }, ]; +// Dynamic Button Components for fast refresh testing +function DynamicTextButton(): React.Node { + const [buttonText, setButtonText] = React.useState('Initial Text'); + const [pressCount, setPressCount] = React.useState(0); + + const onPress = () => { + const newCount = pressCount + 1; + setPressCount(newCount); + setButtonText(`Pressed ${newCount} times`); + }; + + return ( +