亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

In React, execute a function in the parent component by detecting the call of the child component
P粉154798196
P粉154798196 2023-09-10 19:15:14
0
1
800

I need to call a function when a child element of the date picker is clicked

<DropdownParent >
                <DatePicker
                    selectsStart
                    showYearDropdown
                    showMonthDropdown
                    endDate={endDate}
                    selected={startDate}
                    scrollableYearDropdown
                    dateFormat="dd/MM/yyyy"
                    startDate={startDate}
                    yearDropdownItemNumber={10}
                    onChange={(date) => handleChange({ startDateObj: date })}
                    placeholderText={placeholderStart}
                    inline
                    locale="en-gb"
                />
            </DropdownDefaultAtom>

There is a toggle function in DropdownParent, I need to call it when the child function handleChange is called, I tried callbacks and other methods, but since it is a library, I don't know how to detect the change and pass it to the parent component to call the parent function.

P粉154798196
P粉154798196

reply all(1)
P粉470645222

Update the value in Redux, then use it in the change detection of the child component after the value has been updated in Redux, and you can use it throughout the application.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template