Home>
I have a code like this in react. =>How is the ({}) part handled?
const Props = d =>({
onClick (id) {
d (todo (id));
}
});
-
Answer # 1
Related articles
- reactjs - about react function
- reactjs - about warnings about react hooks
- reactjs - about the behavior when submitting form with react
- reactjs - how to combine react strings in gatsby
- reactjs - i want to know why it was rendered twice when running react
- reactjs - react: i want to handle component as an array
- reactjs - [react] even if you change the value of the object using objectassign ({},), it is not rendered and the checkbox does
- reactjs - about the useeffect cleanup function
- reactjs - i bundled react files with webpack + babel, but i don't see the components i mentioned
- html - about the part where mix-blend-mode is not reflected
- reactjs - i don't know the processing order of react
- reactjs - i want to embed code in css values in react
- typescript - react: about component rendering
- reactjs - [react] i want to create a logout button
- reactjs - react + firestore an error occurs when trying to call multiple collections
- reactjs - [react + firestore] i want to display things by specifying a value from firestore
- reactjs - about react-hooks/exhaustive-deps
- reactjs - [react] i want to get the current position and display the map of the location information of the current location
- javascript - [js] about the case where the video is not displayed on the full screen when the window is resized
- reactjs - react navigation how to pass parameters at screen transition
Trends
Hello
const Props
is a function. What kind of function isTakes one argument
Returns and
. Thatd
is also expected to be a function.object. The object has a property called
onClick
, and the value of theonClick
property is also a function.onClick
is a function that takes one argument,id
, and the previously given functiontodo
andPropsd (todo (id))
using the functiond
given as an argument to/code>.The following is a sample to confirm the above.
Codepen for operation check: https://codepen.io/jun68ykt/pen/QWWRyvP?editors=0012