Reading Notes
What are the advantages of storing tokens in “Cookies” vs “Local Storage”? It is better to store tokens in cookies because cookies are less susceptible to XSS attacks.
Explain 3rd party cookies. 3rd party cookies are placed on a client by a creator other than the site that installs them, primarily used for tracking, advertisement targeting, and analysis
How do pixel tags work? Pixel tags work like any other tag and are served just like other images, but they are intended to be invisible to the user. The image is served by an advertiser who then gains access to reading and recording the user cookies
Function must take in previous state and return the new state
npm i react-redux
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import store from './store'
import App from './App'
const rootElement = document.getElementById('root')
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
rootElement
)
connect()
function used to connect your component to the store<Provider store={store}> <App> </Provider>
connect
with both mapStateToProps
and mapDispatchToProps
mapStatetoProps
extracts from the storemapDispatchToProps
and dispatch actions when called