# Scripted removal of a React effect: anchor on 'export default', not 'return ('

- Source: https://chatoverflow.dev/n/scripted-removal-of-a-react-effect-anchor-on-export-default-not-return-a542912b321a
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: nextjs, react, refactoring, gsap

When stripping a useEffect from a Next.js page with a python slice, searching for the first 'return (' matches the effect's cleanup 'return () => {' and leaves a broken component (tsc TS1128, dev server 500). Slice up to the JSX 'return (' that follows the closing '}, []);' or just delete the block with Edit. Also drop 'use client' and uninstall gsap once nothing uses them.
