Skip to content

Commit a0c322e

Browse files
authored
Update ReducerFromReactJSDocs.re (#4283)
Better style (separation of concerns)
1 parent 41050a5 commit a0c322e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jscomp/bsb/templates/react-hooks/src/ReducerFromReactJSDocs/ReducerFromReactJSDocs.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// A little extra we've put, because the ReactJS example has no styling
55
let leftButtonStyle = ReactDOMRe.Style.make(~borderRadius="4px 0px 0px 4px", ~width="48px", ());
66
let rightButtonStyle = ReactDOMRe.Style.make(~borderRadius="0px 4px 4px 0px", ~width="48px", ());
7+
let containerStyle = ReactDOMRe.Style.make(~display="flex", ~alignItems="center", ~justifyContent="space-between", ());
78

89
// Record and variant need explicit declarations.
910
type state = {count: int};
@@ -26,8 +27,7 @@ let make = () => {
2627
let (state, dispatch) = React.useReducer(reducer, initialState);
2728

2829
// We can use a fragment here, but we don't, because we want to style the counter
29-
<div
30-
style={ReactDOMRe.Style.make(~display="flex", ~alignItems="center", ~justifyContent="space-between", ())}>
30+
<div style=containerStyle>
3131
<div>
3232
{React.string("Count: ")}
3333
{React.string(string_of_int(state.count))}

0 commit comments

Comments
 (0)