4 ms·
The first thing I look for in a React contender is how to write a stateful component and how to use that in another component. It's not clear to me how to have
by continuational 6y ago
The first thing I look for in a React contender is how to write a stateful component and how to use that in another component. It's not clear to me how to have local state. Maybe put that on the front page?
- lorean_victor 6y agoAn example of using local state is on the first page (the last example). It might seem unfamiliar because it does not use components, and that is simply because "local state" in Callbag-JSX is simply a "local variable" in JavaScript, which can be defined in any scope. As for components: you are correct, there are no examples of components on the first page. There is one in "Getting Started", but that is a pretty simple one with the state defined outside of the component. That said, "components" in Callbag-JSX are just functions, "stateful components" are functions with closure. Though perhaps I should elaborate on that further.