This repository was archived by the owner on Feb 9, 2024. It is now read-only.
LONDON_10 || SAIM KORKMAZ || HOTEL REACT APP#617
Open
nsaimk wants to merge 26 commits intoCodeYourFuture:masterfrom
Open
LONDON_10 || SAIM KORKMAZ || HOTEL REACT APP#617nsaimk wants to merge 26 commits intoCodeYourFuture:masterfrom
nsaimk wants to merge 26 commits intoCodeYourFuture:masterfrom
Conversation
? const Example = (props) / ({order}).
first one need a property
? "const [bookings, setBookings] = useState();
setBookings(FakeBookings);" gives the eroor "o many re-renders. React limits the number of renders to prevent an infinite loop.
", so instead the current syntax is used
Added a handy link, will come back later
Q. Why we use arrow function inside the onClick instead of only calling the function? --To avoid immediate invocation of the function. When the user clicks the button, the handleClick method is called.
|
Kudos, SonarCloud Quality Gate passed! |
kitko112
reviewed
Jul 17, 2023
| .new-booking button{ | ||
| background-color: rgb(215, 213, 74); | ||
| } | ||
| .highlighted0{ |
There was a problem hiding this comment.
What elements are using these classes? if the styles are the same, one css class is enough.
if you want to style particular item in a list of item, you can try below class
li:nth-child(odd) // item with odd index
li:nth-child(even) // item with even indexx
li:nth-child(2) // All
| .catch((error) => { | ||
| setError(error.message); | ||
| }); | ||
| }, []); |
There was a problem hiding this comment.
Nice use of dependencies array in useEffect
|
|
||
|
|
||
| const handleChange = (e) => { | ||
| setNewBooking({ ...newBooking, [e.target.name]: e.target.value }); |
There was a problem hiding this comment.
A short and clear way to update the booking, Nice one
| .then((data) => { | ||
| setCustomerInfo(data); | ||
| }); | ||
| }, [id]); |
There was a problem hiding this comment.
Nice one, only the id change will trigger the useEffect
|
|
||
| const Order = ({ orderType }) => { | ||
| const [orders, setOrders] = useState(0); | ||
| const orderOne = () => { |
There was a problem hiding this comment.
FYI
another way to use the setOrders
setOrder((order) => order + 1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








No description provided.