اختر مثالًا لتفتحه بملء الشاشة: المعاينة الحية وكوده المصدري جنبًا إلى جنب.
الـ component دالة عادية. وكل استدعاء لـ Counter() يحتفظ بعدّاده الخاص.
Counter()
import 'nuclo' function Counter(label: string) { let count = 0 // one per call return button(() => `${label}: ${count}`, { onClick: () => { count++; update() }, }) } export const Counters = () => div(Counter('A'), Counter('B'))