Problem I’d like to be able to track a users location even when the app is no longer in the foreground (e.g. The user has switch to another app or switched to the home screen and locked their phone). The use case would be a user tracking a run. They could open the app and press ‘start’ at the beginning
Tag: reactjs
Docker is not accepting proxy api server
i get the following error, when doing a docker-compose up. The app is running but cannot make any api post/get requests. The express server is using port 5000. ] [HPM] Error occurred while trying to proxy request /api/users/user from localhost:3000 to http://localhost:5000/ (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) Despite having the react proxy set up, the error persists. setupProxy.js Dockerfile docker-compose.yml package.json Answer I
How to set focus on carousel containing image or a div so that i can navigate using arrow keys?
I have been working on Ant Carousel :- https://ant.design/components/carousel/ . Carousel is placed inside a Modal. I have few children div. Initially arrow keys do not work for navigation. If I click on content of div, then they start to work. But if div contains image, when clicked on it focus is not set to carousel, also if there is
How can I use multiple refs for an array of elements with hooks?
As far as I understood I can use refs for a single element like this: How can I implement this for an array of elements? Obviously not like that: (I knew it even I did not try it:) I have seen this and hence this. But, I’m still confused about how to implement that suggestion for this simple case. Answer
Cannot change the background colour of
I’m using react and I came across a side navbar that I like. However I cannot change it from the default red background colour. I tried making my own custom css, and trying entering className: bg-dark etc on any line possible and it isn’t working? Can anyone help? Also here is a link to the side where I found this
why vscode is not recognizing react code as react javascript instead it format it as vanilla javascript
I am using Prettier with format on save enabled but when I make any change in App.js and save it Prettier do destroy my code because it deals with it as plain javascript Answer I am using create-react-app so it produce the main component App.js I am using .JSX in the other components but the problem is when I make
How can I set the size of icons in Ant Design?
So when I’m using an Icon in Ant Design it is always 14 * 14 px. Is there a way to set the size maually? Things like or do not work Answer Can change the size of the icon using fontSize style property. eg: use of style={{ fontSize: ‘150%’}}
Triggering a function via onClick with a React-Bootstrap ListGroup
Given two components, one just being the render of a react-bootstrap ListGroup, and the other being a function containing a console.log print out, I’m running into trouble seeing that printout when using onClick in the listgroup item. I’m building a music player and the list group contains songs to click on. When I try to remove <Player Player = />
How to show only specific days react-dates
I have array of days. I only want to show the above selected days in the airbnb datepicker and disable the other ones. How can I do that? Thank you Answer You will have to use the isDayBlocked prop of the date picker. The following function will find if a day is contained inside your array, and return true if
Passing value from p5 sketch to React (with react-p5-wrapper)
I have a p5 webcam video prediction system working right now. Currently, I’m trying to plug this into a React app to create a fuller web app. My problem is, the prediction is now only made in my p5 sketch, I want the prediction value to be passed into React’s App.js for further constructions. Is there any method of doing