React.useState does not reload state from props

The argument passed to useState is the initial state much like setting state in constructor for a class component and isn't used to update the state on re-render If you want to update state on prop change, make use of useEffect hook functionAvatar(props){const[user, setUser]=React.useState({...props.user

run async/await in loop

constpromises = (photo: any) => { constdeleteResult: any = awaitquery(gql` mutation { deletePhoto(id:"${}") } `) count += 1 })

setup git account on mac with ssh - push to remote denied with other login


SSH uses public-key cryptography to authenticate the remote computer and allow it to authenticate the user, if necessary. There are several ways to use SSH; one is to use automatically generated public-private key pairs to simply encrypt a network connection, and then use password authentication to log on.” An SSH key basically lets your computer uniquely identify itself when it connects to servers. If Github is aware of the key your computer is using, you won’t have to enter your Github username/password every time you connect. Check for pre-existing SSH keys on your computer Let’s see if your computer has one or more keys already installed:
12# Point the terminal to the directory that would contain SSH keys for your user account.$ cd ~/.ssh If you get the response “No such file or directory”, skip to Generate a new SSH Key. Otherwise, you’ll need to backup and remove your existing SSH keys. Backup and …

ERROR:root:code for hash md5 was not found.

brew install openssl brew link openssl --force brew uninstall python brew install python --with-brewed-openssl> fsevents@1.2.12 install /Users/junwang/Documents/my-apps/my-app-ts/node_modules/fsevents > node-gyp rebuild ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.15_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 97, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 147, in <module> …

Cloud Firestore vs the Realtime Database: Which one do I use?