Skip to content

rx.Script causes UNSAFE_componentWillMount warning #5780

@tim-haselhoff

Description

@tim-haselhoff

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:

  1. Make a reflex app
  2. Open it on the browser
  3. 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.

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions