Open lccambiaghi opened 3 years ago
I just find how to manipulate flat-list
, so I write here my solution.
(ns ...
(:require [reagent.core :as r]
[reagent.react-native :as rn]))
;; ....
[rn/flat-list
{:data [{:key "Devin"}
{:key "Devn"}
{:key "Den"}
{:key "Jay"}]
:keyExtractor (fn [item index] (:key item))
:renderItem (fn [props]
(let [item (:item (js->clj props :keywordize-keys true))]
(r/as-element
[rn/text {:style {:color "black" :textAlign "center"}} (str item)])))}]
The two important points here are :
renderItem
must return an elementrenderItem
is a Javascript object, not a Clojure one.
Hi, I am a beginner with
reagent
as well asreact-native
. Sorry if my question is trivial, I would be grateful to be pointed out to resources where to learn aboutreagent
. I am following the React Native docs and I cannot figure out how to use the components in the issue title.This is how far I got:
How can I actually display the values of the maps?