
Connect the rectangle button to Redux by dispatching set tool type on click. Read the selected tool from the whiteboard slice to toggle the button's active state.
Handle the mouse up event on the canvas to stop drawing, reset the action to null, and clear the selected element, preparing for drawing shapes like a rectangle.
Add a new line tool by introducing a line icon button, importing the line icon, updating tool types and Redux state, and implementing line drawing logic similar to the rectangle.
Create a line element on a collaborative whiteboard by handling mouse down, setting the selected element, and updating the Redux store with the new line coordinates.
Draw line on the canvas by updating its coordinates in the store. Add a line case to the draw function so the line renders for all users using rough canvas.
Fix a console error by adding the missing break in the update element’s switch case, enabling freehand drawing tool. The session demonstrates real-time collaboration and notes a future text tool.
Learn how to refactor the handle mouse down handler to add a new text writing action, update tool-type logic, and manage the selected element in the store.
Render a text area at the clicked location when writing, with 24px sans serif font, and blur updates the canvas via the elements array.
Fix the get context from null error by adding the canvas id, then draw text on the canvas and fix a jumping position in upcoming video.
Fixes a position bug in the get element at position logic by mapping elements to identify the element under the cursor and updating the cursor appearance accordingly.
Identify the element at the cursor position and select it. Use element-at-position logic to move or resize with the mouse.
Calculate offset on mousedown, set selected element with that offset, and update its position on move to enable moving or resizing in a collaborative whiteboard using react canvas and socketio.
Let's create amazing Application - Collaborative Whiteboard. Course is designed in the practical way. We will start from scratch and finish with complete application. Main goal of this course is to play with technologies like React, Redux, JavaScript, SocketIO and learn how to work with HTML Canvas in React. Thanks to SocketIO we will add some realtime effects to our application. We will share our moves with other Users which will give us effect of Collaborative Whiteboard. At the end we will add tracking system for Cursors of all connected users to our App.
What we will learn through the course:
Creating React Application from scratch
Working with Redux State Management
Adding HTML Canvas to React Application
Handle Mouse Events to create new shapes
Use hooks to manage state of the Canvas
Creating Rectangles, Lines, Freehand drawings and Text
Adding functionality of moving and resizing elements
Creating SocketIO Server
EXTRA Collaborative part of sharing our actions on canvas with other Users
Sharing cursors with all connected users
Who this course is for:
New beginners to create amazing project
Anyone who wants to learn how to create basics shapes on Canvas
Anyone who wants to learn how to share your actions with other users thanks to SocketIO
Anyone who wants to work with Canvas in React
Adding HTML Canvas to React Application