Fork me on GitHub
#cljsrn
<
2021-05-27
>
hkjels19:05:35

What would be the clojurescript/reagent equivalent to

const renderBackdrop = useCallback(
    (props: BottomSheetBackdropProps) => (
      <BottomSheetBackdrop {...props} pressBehavior={backdropPressBehavior} />
    ),
    [backdropPressBehavior]
  );
the props: and {…props} syntax is new to me

hkjels19:05:15

props is just a named argument with BottomSheetBackdropProps passed in

hkjels19:05:27

and {...props} is some sort of destructuring

dnolen19:05:56

it's just a splat

dnolen19:05:21

JSX stuff is not a function - so you use that pattern to drop all those props in as attributes

dnolen19:05:50

[bottom-sheet-backdrop (assoc props :press-behavior ...)] something like this is equivalent at a high level

3
Michael Jung19:05:22

@dnolen Thanks for clarifying. Might very well have been the case in my situation.

dnolen19:05:00

no problem, it's important to remember if you forget you will see all kinds of headscratchers

dnolen19:05:07

least of all problems w/ the REPL

Mark22:05:17

hi everyone, good afternoon. Does anyone know how to navigate to a specific route in the app from within a reg-event-fx?