Previous Episode: 27: State of Elm
Next Episode: 29: Elm in React Live

We are back to meow notes, adding our onClick event from Elm back to React to route either to a new note, or an existing note by note.id. This is going to require us to poke another hole in our ports, but remember Murphy’s warning, not to treat this like http methods, so lets keep that in mind as we move forward.

 

Extra Type Alias I had made a type alias Notes = List Note Mostly because the compiler was complaining at one point, and I wasn’t able to see to distill from it that all I needed was some parentheses around List Note to disambiguate it. Tackling the onClick event

List.map (\n -> Listgroup.li [ onClick (routeTo "/notes/" ++ n.noteId) ] [ text n.content ]) notes

that was my first thought, but.. The 1st argument to function `li` is causing a mismatch. - Function `li` is expecting the 1st argument to be: List (Listgroup.ItemOption msg) But it is: List (Html.Attribute a)

grrrrrr

List (Html.Attribute msg) But the right side is: Html.Attribute Msg What I finally got Listgroup.button [ Listgroup.attrs