-
|
Anyone coming from React is familiar with controlled components. As I was working through building the thinkster realworld demo, I was able to remove the I'm wondering if I'm missing something? If not, I think we should add a "controlled components" section to the docs as it's a breath of fresh air Demo Login Form: https://codesandbox.io/s/busy-haze-ypse4?file=/src/index.js |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
|
So FWIW I don't need to use a generator here if I don't expect this component to render after the first yield. The generator brings value if I want to safely maintain the While this works in React land, you never do it because those values aren't state and get blown away on every re-render. |
Beta Was this translation helpful? Give feedback.
So FWIW I don't need to use a generator here if I don't expect this component to render after the first yield. The generator brings value if I want to safely maintain the
emailandpasswordvalues as state over subsequent updates to the component (like prop updates).While this works in React land, you never do it because those values aren't state and get blown away on every re-render.