summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b28c923)
It was only one line, and only called once, so better just to inline it.
const PromptOptions = React.memo(props => {
const PromptOptions = React.memo(props => {
- function handle_click(id) {
- fetch_post_json(`vote/${id}`);
- }
-
if (props.prompts.length === 0)
return null;
if (props.prompts.length === 0)
return null;
<button
className="vote-button"
key={p.id}
<button
className="vote-button"
key={p.id}
- onClick={() => handle_click(p.id)}
+ onClick={() => fetch_post_json(`vote/${p.id}`) }
>
{p.prompt}
<div className="vote-choices">
>
{p.prompt}
<div className="vote-choices">