|
home | manual | reference | regression | sequence | develop | apps |
Examples/counter
PHP
examples/counter.phpHTML
examples/counter.padResult <?php
$title = 'Counter Demo - PAD + React';
// Initial counter value from server
$initialCount = 10;
?><h1>Interactive Counter Demo</h1>
<p>A complete React counter application with multiple features.</p>
<div id="counter-app" data-initial-count="{$initialCount}"></div>
<script type="text/babel" src="/react/counter/app.js"></script>
<h2>About This Demo</h2>
<p>This counter demonstrates:</p>
<ul style="margin-left: 20px; line-height: 1.8;">
<li><strong>State management</strong> - Using React's useState hook</li>
<li><strong>Event handling</strong> - Button clicks and input changes</li>
<li><strong>Conditional rendering</strong> - History only shows when available</li>
<li><strong>Server integration</strong> - Initial count from PAD/PHP: {$initialCount}</li>
<li><strong>Dynamic UI</strong> - Disabled button when history is empty</li>
<li><strong>Controlled components</strong> - Step size input</li>
</ul>Interactive Counter Demo
A complete React counter application with multiple features.
About This Demo
This counter demonstrates:
- State management - Using React's useState hook
- Event handling - Button clicks and input changes
- Conditional rendering - History only shows when available
- Server integration - Initial count from PAD/PHP: 10
- Dynamic UI - Disabled button when history is empty
- Controlled components - Step size input
|
home | manual | reference | regression | sequence | develop | apps |
(c) 2003-2025 Herbert Groot Jebbink