rx.Script causes UNSAFE_componentWillMount warning
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the minimal Reflex app in the issue and reproduce the browser-console warning from rx.script under strict mode. Trace the rx.script rendering path to identify the source of the warning, then verify that the same reproduction runs without the UNSAFE_componentWillMount warning.
Written by the indexing model from the issue text.
Description
Describe the bug
A clear and concise description of what the bug is.
When using rx.script I get the Warning: "Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code." Is this a mistake on my part or unintended behaviour?
To Reproduce
Steps to reproduce the behavior:
- Make a reflex app
- Open it on the browser
- Check the browser console
- Code/Link to Repo:
import reflex as rx
def index() -> rx.Component:
return rx.vstack(
rx.text("Hello, Reflex!"), rx.script("console.log('inline javascript')")
)
app = rx.App()
app.add_page(index)
Expected behavior
A clear and concise description of what you expected to happen.
No Warning
Screenshots
If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
- Python Version: 3.13
- Reflex Version: 0.8.8 / 0.8.10
- OS: Linux
- Browser (Optional): Chrome
Additional context
Add any other context about the problem here.
- Dominant language
- Python
- Stars
- 28.9k
- Forks
- 1.8k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 170
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reflex-dev/reflex
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
reflex-dev/reflex#7149 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reflex-dev/reflex#7148 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
reflex-dev/reflex#7103 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reflex-dev/reflex#6823 · 1 comment ·
-
support redis v8 Openfeature request
Difficulty 1/5 Under an hour Newbie friendliness 88/100
reflex-dev/reflex#6764 · 3 comments · 1 reaction ·
All issues in reflex-dev/reflex
Similar issues
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100