Skip to content

Conversation

@JamieMagee
Copy link
Contributor

Summary

  • Replace string refs with React.createRef() in PageCurate and FilterBar
  • Remove ReactDOM.findDOMNode usage in SavePopUp

Details

This PR removes deprecated React patterns that will break or cause issues when upgrading to React 17:

String refs (ref="stringName") have been deprecated since React 16.3. These are replaced with React.createRef() which is the modern approach.

ReactDOM.findDOMNode is deprecated and will be removed in a future React version. In SavePopUp, it was being used to directly manipulate a textarea's value. Fixed by converting the textarea from an uncontrolled component (defaultValue) to a controlled component (value), so React handles the updates properly.

Testing

All 126 existing tests pass. The deprecation warnings from react-bootstrap's Modal component are expected and will be resolved when we upgrade react-bootstrap as part of the React 17 migration.

Replace string refs with React.createRef() in PageCurate and FilterBar
components. String refs have been deprecated since React 16.3 and will
not work in future versions.

Remove ReactDOM.findDOMNode usage in SavePopUp by converting the
template textarea from an uncontrolled component (defaultValue) to a
controlled component (value). This eliminates the need for direct DOM
manipulation when updating the textarea content.

These changes are prerequisites for upgrading from React 16 to React 17.
@netlify
Copy link

netlify bot commented Jan 16, 2026

Deploy Preview for blissful-goodall-fa23f6 ready!

Name Link
🔨 Latest commit 403510c
🔍 Latest deploy log https://app.netlify.com/projects/blissful-goodall-fa23f6/deploys/696acba79ff2dc00081cbdf5
😎 Deploy Preview https://deploy-preview-1098--blissful-goodall-fa23f6.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes React patterns to prepare for React 17 upgrade by removing deprecated APIs that will break in future React versions.

Changes:

  • Replaced deprecated string refs with React.createRef() in PageCurate component for modal management
  • Removed deprecated ReactDOM.findDOMNode usage in SavePopUp and converted textarea from uncontrolled to controlled component
  • Updated FilterBar to use callback ref pattern consistently (removed unused React.createRef())

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/components/PageCurate.js Converted string refs (ref="contributeModal", ref="proposeModal") to React.createRef() for ContributePrompt and ProposePrompt modal components
src/components/Navigation/Ui/SavePopUp.js Removed deprecated ReactDOM.findDOMNode usage and converted textarea from uncontrolled (defaultValue) to controlled component (value) with proper state management
src/components/FilterBar.js Updated to properly use callback ref pattern by initializing this.typeahead to null instead of unused React.createRef(), consistent with existing callback ref in render method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants