What the agent does
The agent clones the repository into its own cloud sandbox and reads how styled props are used before bumping the version. In a React front end like the client/ of Pobermeier/vintage-poker, a Create React App 3 project, client/package.json asks for "styled-components": "^5.1.1", pinned to 5.1.1 by the lockfile, with react 16.13, react-router-dom 5.2, prop-types and react-scripts 3.4.3; there are no test files. src/components/buttons/Button.js defines styled.button whose template reads props.primary, props.secondary, props.large, props.small, props.fullWidth and props.fullWidthOnMobile to switch its css blocks, and declares them in Button.propTypes. A search for <Button with those props finds 21 call sites in 13 files, such as <Button small primary onClick={clickHandler}> in cookies/CookieBanner.js line 85 and <Button as={Link} to="/register" primary small> in navigation/Navbar.js line 58; typography/ColoredText.js reads props.secondary the same way.
Then it reproduces the warning on both versions with a server render, since the app has no tests and react-scripts build on this CRA release fails on Node 22 with ERR_OSSL_EVP_UNSUPPORTED unless NODE_OPTIONS=--openssl-legacy-provider is set. Bundling a script that renders <Button primary small> inside the app's ThemeProvider through react-dom/server in development mode prints nothing on 5.1.1, because styled-components 5 filtered unknown props off DOM elements itself. After npm install styled-components@6, 6.6.0 today, the same render prints styled-components: it looks like an unknown prop "primary" is being sent through to the DOM, which will likely trigger a React console error, the same line for "small", and then React's own Warning: Received true for a non-boolean attribute primary (React quotes the value and the name in backticks), because 6 forwards every prop to the element.
The fix is the transient-prop form the warning itself suggests: every props.primary in the template becomes props.$primary, and so on for the other five, and each of the 21 call sites passes $primary, $small, $secondary, $large, $fullWidth or $fullWidthOnMobile instead. The propTypes block is renamed to match. Rendered again on 6.6.0, the button comes out as <button class="sc-bdnzMm kqNcDP">Accept</button> with no warning from either library. ColoredText.js gets the same treatment for secondary.
The agent then runs the production build with the legacy OpenSSL option so there is a build to compare, and it completes with CRA's usual serve -s build closing lines. It records in the description that the OpenSSL flag is a Node 22 workaround for react-scripts 3 and that moving to a current build tool is a separate change, and lists the other 49 files that use styled and needed no edit because they pass no custom props to DOM elements.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Upgrade styled-components from 5 to the current 6 release. Read package.json and every file that calls styled or css, and list each styled component whose template reads a custom prop, with the prop names and the call sites that pass them. Render one such component with react-dom/server in development mode on the current version, then install styled-components 6 and render again, quoting every warning. Convert each custom prop to a transient prop with the $ prefix in the template, the propTypes and every call site, and render again to show both the styled-components warning and React's non-boolean attribute warning are gone. Run the production build and quote its last lines; if it needs a Node option to run, say which and why. Open a pull request that lists each file changed and the props converted.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
What comes back is a pull request touching client/package.json, Button.js, ColoredText.js and the 13 files that pass those props, with the lockfile moved to styled-components 6. The description lists the six prop names and the 21 call sites, quotes the three warnings from the first render on 6, shows the clean render after the $ conversion, and ends with the build's closing lines and the Node option it needed.
A reviewer checks that every props.primary in a css block was renamed together with its call sites, since a template reading $primary while a caller still passes primary silently loses the style, and that as={Link} buttons still receive to, which is a real prop and stays unprefixed. The run's record holds all three renders and the build, so the warnings and their disappearance can be read rather than assumed.
Run it on every pull request labelled dependencies
A dependency bot opens the styled-components bump that brings this warning. Add an automation to the repository's Project with a github trigger on pull_request.labeled, its labels filter set to dependencies, and this prompt. When the bot's pull request is labelled, the run starts with the pull request event placed after the prompt, renders the styled components on the bumped version and opens its own pull request with the transient-prop conversion to merge first.
The trigger fires only for labels applied by an owner, member or collaborator, never for pull requests from forks, and the automation's max_runs_per_hour caps how often it starts. A bump of a different package ends with a report and no change.
The use case this job follows, with its automation and trigger: Upgrade dependencies weekly.
Why run it on Rush?
A styling-library major that forwards props differently breaks nothing at build time and prints its warnings only when a component renders, so a laptop upgrade looks clean until the browser console fills. The agent renders the components in its own sandbox on both versions and quotes the warnings with the prop names, and every render stays in the run's record.
The conversion touches a template and every caller of it, and a half-done one fails silently. Because the agent lists the call sites first and renders after the change, the pull request shows the count it converted and the clean output, which is more than a search-and-replace can promise.
Frequently asked questions
Why does styled-components 6 forward unknown props?
Version 6 dropped the built-in @emotion/is-prop-valid filter that 5 applied to DOM elements, so a boolean styling prop like primary now reaches the <button> and React warns about a non-boolean attribute. Transient props, with a $ prefix, are consumed by the styled template and never forwarded, which is the form the library recommends.
Is there a way to keep the old filtering instead?
Yes: wrap the app in <StyleSheetManager shouldForwardProp={isPropValid}> from @emotion/is-prop-valid. That restores 5's behaviour for every component at once, but it keeps relying on a list of valid HTML attributes and hides props that reach the DOM by mistake. The agent converts to transient props and names the StyleSheetManager option in the description for teams that prefer it.
Why render with react-dom/server instead of running the app?
The warning is printed by the library during render in development mode, whatever the renderer, so a server render in the sandbox shows the same text the browser console would. It also works without a display and without the dev server, and its output goes into the run's record.
What about the OpenSSL build error on Node 22?
It comes from react-scripts 3's webpack 4, not from styled-components, and the legacy provider option is the known workaround. The agent uses it to get a build for this pull request and names the react-scripts upgrade as a separate change rather than folding a build-tool migration into a prop rename.
More jobs like this: Upgrade dependencies weekly
- Fix "AttributeError: module 'urllib3.util.ssl_' has no attribute 'DEFAULT_CIPHERS'" After Upgrading Requests (urllib3)
- Fix useNewUrlParser Is a Deprecated Option When Upgrading Mongoose (Mongoose)
- Fix "[DEP0044] The util.isArray API Is Deprecated" on Node 22 in NeDB (NeDB)
- Fix "Package subpath './v4' is not defined by exports" When Upgrading uuid (uuid)
- Fix Vulnerable Go Modules in an Echo API (Echo)
- Fix Vulnerable Dependencies in a NestJS App (NestJS)