Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

DateTime Component does not re-render upon SetValue #10

@aniketd

Description

@aniketd

Having:

  H.parentComponent
    { initialState: initialState
    , render
    , eval
    , receiver: HE.input HandleInput
    }
  where

  {...}

  eval :: Query ~> H.ParentDSL State Query Picker.Query Slot Message Aff
  eval = case _ of
    HandleInput thisMoment next -> do
      _ <- H.query SlotFrom (setValue (Just (Right (fromMaybe thisMoment $ aWeekAgoFrom thisMoment))))
      _ <- H.query SlotTo (setValue (Just (Right (fromMaybe thisMoment $ tomorrowFrom thisMoment))))
      pure next

in the parent, does not result in the children datetime components being rendered with the new values. Instead the placeholder text continues to show.

Basically, I'm expecting that thisMoment <- nowDateTime being trickled down from the main/HalogenAff as inputs after awaitBody should result in the datetime components being initialized. However, because the component takes input as unit, querying the child component is the way to set its initial value.

Having those queries fired even in the receiver handler fails to update the child view.

The values in the child components are updated the second time the parent re-renders though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions