Connecting to localhost with React Native

Issue I’m trying to fetch an json from a locally hosted express API using a react native fetch get request. Our react native code is : useEffect(() => { fetch("http://localhost:5000/api/listings") .then((response) => response.json()) .then((responseJSON) => { console.log(responseJSON); setIsLoading(false); setListings(responseJSON); })

Continue reading

Jest test assertion, expect a nested object

Issue When I do the below expect in jest with native test expect(mockOnChange).toHaveBeenCalledWith({ order_type: expect.arrayContaining([‘1’]), number: ”, ouser_ids: expect.arrayContaining([‘user_id1’]), payment_type: expect.arrayContaining([‘2’]), start_date: old_Date, end_date: current_date, state: ‘all’, }); I’m getting the following error Object { "end_date": "2022/06/07", "number": "", –

Continue reading

How to open device's calendar app to add an event from React Native application?

Issue I make fetching data from API, whose results look like this Object { "name": "HackForGood: Grab Hackathon 2022", "site": "HackerEarth", "start_time": "2022-05-29T18:30:00.000Z", "url": "https://grabhackforgood.hackerearth.com/", } Object { "name": "Microsoft Virtual Hackathon 2022", "site": "HackerEarth", "start_time": "2022-05-31T16:00:00.000Z", "url": "https://www.hackerearth.com/challenges/hackathon/microsoft-virtual-hackathon-2022/", }

Continue reading

Push parent arrays element and chidren array into new array in javascript

Issue "items": { "hotdrinks": [ { "id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f", "price": 20, "name": "Tea", "img": "../assets/img/HotDrinks/1_udupibhavan.jpg" }, { "id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f", "price": 25, "name": "Coffee", "img": "../assets/img/Hot Drinks/2_udupibhavan.jpg" }, { "id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f", "price": 50, "name": "Hot Milk", "img": "../assets/img/Hot Drinks/3_udupibhavan.jpg" }, { "id":

Continue reading

FlatList not scrolling

Issue i have created a screen where I display a component that contains a FlatList. For some reason I can’t scroll through the list. Someone who can spot my mistake and point me in the right direction? render-function and style

Continue reading

Background color overflowing out of border radius – React native

Issue applied background color getting overflow out of the border on android <CardView style={{ borderWidth: 0.25, borderColor: colors.secondary400, backgroundColor: "red", …shadows.shadowDefault, shadowOffset: item.shadowOffset, shadowColor: item.shadowColor, shadowOpacity: item.shadowOpacity, shadowOpacity: 0.32, shadowRadius: spacing.SCALE_05, shadowColor: Colors.black, overflow: "hidden", }} > Solution Increase border-radius

Continue reading