ReactDOM.findDOMNode is considered to be an escape hatch in React for when you need to access the DOM directly, but it's generally preferred to use Refs for this instead since it has better support with newer React features such as the experimental concurrent mode.
The usage of ReactDOM.findDOMNode should be removed, and refs should be added if necessary to keep the same functionality in the modified components. This will help us be prepared for new versions of React, and it'll let us try out newer React features that come along.
Since this is a campaign spread across multiple tickets, this ticket focuses on removing findDOMNode from the following components in the web app:
This component is responsible for uploading file attachments with posts. In particular, the code that needs to be changed is responsible for ensuring that pasted files/images are uploaded correctly to either the post or comment textboxes, and that files pasted when not focused on either of those do not get uploaded to the server.
Also, if possible, either E2E tests (using Cypress) or unit tests should be added to confirm that the previous behaviour still works.
For more details or if you have any questions, feel free to reach out to @hmhealey or message me on https://community.mattermost.com where I go by harrison.
If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
Hey! I would like to work on this issue!
Thanks for the help on this, @sahil9001! Let us know if you have any questions
@hmhealey Is there a group chat or channel where I can ask some doubts regarding this?
You can post here about them or ask about them on our community server at https://community.mattermost.com as mentioned above. Either of those will work.