Skip to content

Tag: reactjs

React window is not closing when the user clicks the button

I open a React web app like this in my index.js file: I then want the user to be able to close it, but close button doesn’t work. Here is the Review component: When I click it to close, nothing happens. Is there something I am not doing correctly? Thanks! Answer You’re not calling it as a function…

why the createRef current always null in react

I am developing a simple edit app page, because the form.item initial value did not update by data, so I want to setFieldsValue in the antd 4.x, this is my code looks like: To my surprise, the formRef.current is always null. Am I missing something? what should I do to make the Form.Item value update by data w…

MUI React, Minimum Date

How can I set Minimum Date, so the user can’t pick To Date that is before From Date. Here is my Two Date Pickers, using moment to format the date. Answer You can use the minDate prop: Min selectable date. You can add it to your second DatePicker, like: (Working example)

React – CheckboxTree filter

So i am using this package “react-checkbox-tree” to make a checkbox, but since this is made on classes components and i need to do it with functions and hooks, this is being a bit tricky to my actual skills. My first problem is that when i search for the parent, i only get the last children of the…

How do I associate seperate state to each button?

Hello I am trying to associate a like button with each PaperCard component as shown in the code below. I have included the relevant code. Currently, The like button shows up and every time you click it the counter increases BUT all the buttons share the same state. So I am trying to fix that. I am new to JS