Category : react-redux

index.js const [sendVia, setSendVia] = useState(‘astrolger’); const changeValue = (e) => { e.preventDefault(); console.log(e.target.value) setSendVia(e.target.value); }; const handleSubmit = async e => { e.preventDefault(); }; <div className=’row mt-2′> <div className=’col’ onChange={e => changeValue(e)}> <p>Send By:</p> <input type="radio" id="astrologer" name="sendBy" value="astrolger" /> <label htmlFor="astrologer" className=’ml-1′>Astrologer</label> <input type="radio" id="disciple" name="sendBy" value="disciple" className=’ml-2′ /> <label htmlFor="disciple" className=’ml-1′>Disciple</label><br /> ..

Read more

I have a dictionary containing objects with cards. I would only like to display each card if the current user value is equal to the stored user value. IE, if the a given user created that card. <CardDeck> {this.props.homeTdps.map(function (tdp, key) { if ({currentUser.username} == {this.props.tdpDetail.created_by.username}) return ( <Card.Link key={key} href={`/tdps/${tdp.id}/`} style={{ minWidth: ’20rem’, maxWidth: ..

Read more

I get an error when using useRef() on a jsx element that toggles a drop down menu made with Material-UI. where I seem to get the error: const anchorRef = useRef() ……………………………. <Typography ref={anchorRef} className={classes.link} onClick={handleDropDown} > My Account </Typography> <Menu anchorEl={anchorRef.current} keepMounted open={droppedDown} onClose={handleDropDown} > I get this warning: Warning: findDOMNode is deprecated in ..

Read more

Im am using React with Redux and Redux-Saga and firebase SDK and Im trying to get "chat" object from firebase to iterate through them with Object.keys() but i can’t do anithing with it my code: async function getAllChats (uid) { const allChats = {} await database.ref(`users/${uid}/chats`).once(‘value’, snap => { snap.forEach(snapEl => { database.ref(`chats/${snapEl.val()}`).once(‘value’, chatSnap => ..

Read more

I’m trying to import a function ‘getMoviesList’ written in action/index.js but getting an error even though my code and paths are correct Please have a look on my App.js ( where I’m trying to import that function ) and ./action/index.js ( where I have defined that function ) App.js import React, { Component } from ..

Read more