feat(widgets): Rename StatefulWidget::render
to render_stateful
#1183
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change renames the
StatefulWidget::render
method torender_stateful
to avoid conflicts with theWidget::render
method.Often both the
Widget
andStatefulWidget
traits are in scope, andwhen calling the
render
method on aStatefulWidget
the compilercannot determine which trait to use. This change resolves that issue by
renaming the
StatefulWidget::render
method torender_stateful
.The
StatefulWidget::render
method is still available, but it isdeprecated. A default implementation of
render_stateful
is providedthat calls the deprecated
render
method.Callers should update their code to use
render_stateful
instead ofrender
.implementors of the
StatefulWidget
trait should update theirimplementations to implement
render_stateful
instead ofrender
, andprovide an implementation of
render
that callsrender_stateful
.This change is non-breaking. The deprecated
render
method will beremoved in a future release of Ratatui (likely 0.29.0).
Addresses part of a problem raised in
#996