def test_ref():
    """Test that the ref prop is correctly added to the component."""
    custom_ref = Var("custom_ref")
    ref_component = rx.box(ref=custom_ref)
    assert ref_component._render().props["ref"].equals(custom_ref)

    id_component = rx.box(id="custom_id")
    assert id_component._render().props["ref"].equals(Var("ref_custom_id"))

    assert "ref" not in rx.box()._render().props
Test that the ref prop is correctly added to the component.
tests/units/components/test_component.py