[fix #2903] fix arity bug on iOS
also use ListEmptyComponent prop for section-list
This commit is contained in:
parent
7685b43049
commit
c99af08c4f
|
@ -125,7 +125,7 @@
|
||||||
(defn flat-list
|
(defn flat-list
|
||||||
"A wrapper for FlatList.
|
"A wrapper for FlatList.
|
||||||
See https://facebook.github.io/react-native/docs/flatlist.html"
|
See https://facebook.github.io/react-native/docs/flatlist.html"
|
||||||
[{:keys [data empty-component] :as props}]
|
[{:keys [data] :as props}]
|
||||||
{:pre [(or (nil? data)
|
{:pre [(or (nil? data)
|
||||||
(sequential? data))]}
|
(sequential? data))]}
|
||||||
[flat-list-class
|
[flat-list-class
|
||||||
|
@ -152,14 +152,11 @@
|
||||||
(defn section-list
|
(defn section-list
|
||||||
"A wrapper for SectionList.
|
"A wrapper for SectionList.
|
||||||
See https://facebook.github.io/react-native/docs/sectionlist.html"
|
See https://facebook.github.io/react-native/docs/sectionlist.html"
|
||||||
[{:keys [sections empty-component render-section-header-fn] :as props
|
[{:keys [sections render-section-header-fn] :as props
|
||||||
:or {render-section-header-fn default-render-section-header}}]
|
:or {render-section-header-fn default-render-section-header}}]
|
||||||
(if (and (every? #(empty? (:data %)) sections) empty-component)
|
[section-list-class
|
||||||
empty-component
|
(merge (base-list-props props)
|
||||||
[section-list-class
|
props
|
||||||
(merge (base-list-props props)
|
{:sections (clj->js (map wrap-per-section-render-fn sections))
|
||||||
props
|
:renderSectionHeader (wrap-render-section-header-fn render-section-header-fn)}
|
||||||
{:sections (clj->js (map wrap-per-section-render-fn sections))
|
(when platform/ios? {:SectionSeparatorComponent (fn [] (reagent/as-element section-separator))}))])
|
||||||
:renderSectionHeader (wrap-render-section-header-fn render-section-header-fn)}
|
|
||||||
(when platform/ios? {:SectionSeparatorComponent (fn [] (reagent/as-element [section-separator]))}))]))
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue