@raspasov the problem was with keyExtractor. I was using random-uuid wehereas I had to use a key that won’t change for each item
@ps awesome, glad it worked out 🙂 I knew it had to be on of the properties…
However, even low resolution images are taking long to show in the first place
;needs to return a key as string :keyExtractor (fn [[_ idx]] (str idx)) If I put a comment there, I probably struggled with it, lol
What is “low resolution”? Are you loading from the web?
There’s ways to mitigate that with UI effects, have the image fade-in on load, etc
https://github.com/expo/react-native-fade-in-image (this lib solves a bunch of edge cases around images loading nicely)
Or you can use something like https://github.com/oblador/react-native-animatable (but you’d have to tinker more with it, but it’s more customizable)
For highest performance there’s this https://github.com/software-mansion/react-native-reanimated (esp the v2 version) but it’s harder to use from ClojureScript
I’m loading from aws cloudfront
which I think is a cached aws s3 bucket
@raspasov react-native-fade-in-image is awesome!
Works well? 🙂
Is there a way to know how much progress have been made in sending a multipart request?
I have the following re-frame handler that sends a multipart request:
(reg-event-fx
:upload-video
(fn [cofx [_ navigation]]
(let [body (js/FormData.)
file (clj->js {:uri (-> cofx :db :uri) :name "movie.mov" :type "video/quicktime"})
thumbnail (clj->js {:uri (-> cofx :db :thumbnail-uri) :name "thumbnail.png" :type "img/png"})]
(prn "file is" file)
(prn "uploader is " (-> cofx :db :_id))
(.append body "video" file)
(.append body "thumbnail" thumbnail)
(.append body "title" (-> cofx :db :video-name))
(.append body "uploader" (-> cofx :db :_id))
{:db (->
(assoc (:db cofx) :uploading-progress true)
(assoc :upload-error false))
:http-xhrio {:method :post
:uri (str server-uri "/api/upload-video")
:body body
:on-success [:upload-success navigation]
:on-failure [:upload-error navigation]
:format (json-request-format)
:response-format (raw-response-format) #_(edn/edn-response-format)}})))
it is sending a video and an image. I want to know how much progress has been made in the upload
Are people using krell or re-natal nowadays?
shadow-cljs
shadow-cljs for react native development?
had no idea it could do that, thanks!
I do think you can also use figwheel-main without re-natal these days.
I use figwheel-main
No re-natal needed these days, that’s correct
I love shadow-cljs, will try this out first. re-natal was such a headache back in the day.
Both should work pretty well (shadow-cljs and figwheel-main)
I am also in love with shadow-cljs. Just relaying that, because I need to. 😍
I’m adding a DateTimePicker into my app like so:
[:> DateTimePicker
{:testId :dateTimePicker
:value (Date. 1598051730000)
:mode :date
:is24Hour false
:display :default
}]
Give js/Date
a try.
According to the docs https://www.npmjs.com/package/@react-native-community/datetimepicker#rn--060 which use
new Date()
But I’m getting the following error: