skip to Main Content

Reactjs – React Use state run twice

I'm trying to run my Setup function once when the Discord Activity loads (https://discord.com/developers/docs/activities/how-activities-work). My code somehow runs the function twice and creates an error. Here is the code I'm using: function App() { const [auth, setAuth] = useState<authType>(null); async…

VIEW QUESTION

Reactjs – How to have the same transparency mask on every ant design modal?

{filteredBookings.map((booking, index) => ( <Modal key={index} // Make sure to provide a unique key open={detailModalVisible} onCancel={(e) => { setDetailModalVisible(false); setCurrentBookingIndex(null); }} footer={null}> <EachBooking key={currentBookingIndex} // Ensure EachBooking components have unique keys selectedBooking={selectedBooking} roomId={selectedRoomId} roomName={selectedRoomName} username={username} toPreviousMainModal={toPreviousMainModal} /> </Modal> ))} I…

VIEW QUESTION
Back To Top
Search