Relative Content

Tag Archive for reactjsreact-native

how to display current date in text input’s placeholder in react native

`<View style={styles.dateInput}> <Text style={styles.text}>To Date</Text> <TouchableOpacity onPress={() => showDatePicker(false)}> <TextInput placeholder=”Select Date” value={toDate} editable={false} style={styles.dateinput} /> </TouchableOpacity> </View> <DateTimePickerModal isVisible={isDatePickerVisible} mode=”date” onConfirm={handleDateConfirm} onCancel={hideDatePicker} />` i want to display current date in place of “Select Date” in placeholder. i have a datepicker input for selcting the date. reactjs react-native

Detecting Walls in Images for a React Native App

I’m currently working on a React Native app and need some help with a feature that involves image processing. The app allows users to take a picture of a room and then select a wall to paint with a chosen color.

how to create a query of action to fetch data in react

I created a People component that display people information like name, department and others. It receive email address and then request a API endpoint to get detail data. and I use this component in a table, one for each row. Now my problem is this component fires lots of request to API when table load, but in fact many of them are duplicated because the there are same people in multiple rows. I use local cache to cache the fetch result, but it doesn’t work for the initial loading. for example, my table have 10 rows, it will fires 10 request to API for each row. but in fact there are only 3 person in this table. So I’m wondering if there is a way to setup a query or something so that it can reduce the request number from 10 to 3. Thank you.

A function to delete notes in a notetaking app isn’t working

So I have a rough notetaking app in React Native, and the function that’s supposed to delete the currently selected note isn’t working. It’s supposed to work from two ends: longpressing the preview of the note, and from the note viewing screen itself.

Creating an onChange function within a dynamic custom slider

I’m working on a project where I need a slider. Originally, I was using a package, but the more custom aspects of the package that I needed weren’t working properly, so I decided to make my own. I’ve made reusable components before, but never to this level of customization. The problem that I’m having is I need my slider to have an onChange function were I can get the updated slider values and set the state of variables in my parent component. I was able to get the value of the slider to update properly for onChange was by using a useEffect, which is probably not the best and causes an infinite loop when I try to change the state of the variables in the parent component.
Another way I was able to get the value to update properly was updating the onChange value directly in the useMemo where my panresponder is, and while this doesn’t cause an infinite loop, it prevents the slider from working when I try to change the state of the variables in the parent component. Does anyone have any advice on how to get this to update and work properly?