envincebal

1

votes
1

answer
66

views

How to click an element and move it to another element

I'm trying to build a chess game in React with just the bishop and knight pieces. I'm stuck trying to figure out how to detect when a piece is clicked and how to move the piece from one square to the square I choose. Do I need to use event.target to accomplish this? Any help would be greatly appreci...
envincebal
1

votes
0

answer
20

views

How to allow only one decimal between operators (Calculator app)

I've been racking my brain trying to figure out how I can prevent more than one decimal for each number between arithmetic operators. Also, would it be more memory efficient to use event delegation when clicking a button instead of looping and adding event listeners? Any help would be greatly apprec...
envincebal
0

votes
0

answer
6

views

How do I get pagination to work on my Node blog site?

I'm building a blog site and trying to use pagination to display different pages of blog posts when there are more than 3 posts stored in the database. I'm trying to pass data from the front-end when pushing 'newer' or 'previous' buttons to the back-end to control the pages. How can I go about doing...
envincebal
1

votes
1

answer
76

views

Updating state before rendering (React)

I've been racking my brain for hours trying to figure an issue out. Basically, I want the markersList property in the state to be updated before the component is rendered. the markerList is suppose to be populated with Google Maps markers being pushed into the array in the initMap() method. But when...
envincebal
2

votes
1

answer
32

views

I get a 404 error when reloading React Router app

When I reload my app on a local server, everything is fine. But when I reload the page while hosting on gh-pages, I get a 404 error. It doesn't do this on the home page, but it does on the other 2 pages. Does it have something to do with the fact that it is being hosted remotely? I'm a bit of a noob...
envincebal