S
S
SeniorScript2021-02-22 21:48:00
React
SeniorScript, 2021-02-22 21:48:00

How to make like button for React Redux Firebase post?

Good day!
How to make like button for React Redux Firebase post?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery, 2021-02-22
@vmakhnyuk

1. Create a like component

You should store posts in Firestore, it is desirable that posts have a field likes: [...userId]so that the user cannot like the post indefinitely.

2. Render the post components. if the post likeshas a iduser, then block the like button.
3. in the editor, just syncath, likeaction - if the like request is resolved with success, update the state of the posts locally.
This is just my opinion on the implementation, comments are welcome.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question