Reflex Logo

Intro

Gallery

Hosting

Learn

Components

Recipes

API Reference

Onboarding
Hosting

Api-reference

/

Base

reflex.base.Base

The base class subclassed by all Reflex classes.

This class wraps Pydantic and provides common methods such as serialization and setting fields.

Any data structure that needs to be transferred between the frontend and backend should subclass this class.

SignatureDescription
json(self) -> 'str'Convert the object to a json string.
set(self, **kwargs)Set multiple fields and return the object.
get_fields(cls) -> 'dict[str, Any]'Get the fields of the object.
add_field(cls, var: 'Any', default_value: 'Any')Add a pydantic field after class definition. Used by State.add_var() to correctly handle the new variable.
get_value(self, key: 'str') -> 'Any'Get the value of a field.

Did you find this useful?

HomeGalleryChangelogIntroductionHosting