Create a twitch clone using React -5

Photo by Jerry Wang on Unsplash

Welcome to Part-5 of the series. You can find part-4 here.

Let’s start where we left. We would like to associate users, to our stream so that we can add a Delete and Edit button for the logged in user, of that stream.

Open the index.js file in src -> actions folder and add the userId in createStream().

export const createStream = formValues => async (dispatch, getState) => {
const { userId } = getState().auth;
const response = await'/streams', {...formValues, userId});
dispatch({ type: CREATE_STREAM, payload: })

Now, move to http://localhost:3000/streams/create and create a new stream.

New stream with userId

You can read the rest of the article from my blog site. The link for the same is below.

You can find code till this point here. You can find Part-6 here.




Founder TWD, JavaScript & ReactJS Trainer, Youtuber, Blogger

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Static vs src/assets in Vue CLI Webpack Templates

Mermaid🧜🏽‍♀️: Fun Way to Make Cool Diagrams

Image Slider with React Slick

Reasons to choose Angular for architecting an Engaging and Attractive Website!

Setting up a NextJS env with Yarn 2

東 (Japanese Kanji) — east

Max Sub-Array Sum (Javascript)

How and why to use JavaScript navigator.sendBeacon ?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nabendu Biswas

Nabendu Biswas

Founder TWD, JavaScript & ReactJS Trainer, Youtuber, Blogger

More from Medium

Build a Web Page from Scratch with React & Node

Using React with Express

From VanillaJS to ReactJS, Complete React Tutorial EP-1.

Develop Full-Stack web application using MERN Stack