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

DateTime Component does not re-render upon SetValue #10

Open
aniketd opened this issue Jan 25, 2019 · 0 comments
Open

DateTime Component does not re-render upon SetValue #10

aniketd opened this issue Jan 25, 2019 · 0 comments

Comments

@aniketd
Copy link

aniketd commented Jan 25, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant