-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: replace rerenderInAction
to: renderPage
and renderComponent
#682
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aralroca
changed the title
feat: replace
feat: replace Dec 15, 2024
rerenderInAction
to these: renderPage
and renderComponent
rerenderInAction
to: renderPage
and renderComponent
brisa-adapter-vercel
brisa-pandacss
brisa-tailwindcss
brisa
create-brisa
www
commit: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #648
🚨 BREAKING CHANGE:
rerenderInAction
is anymore supported. Replaced torenderPage
andrenderComponent
The
renderComponent
in this PR also allows to render a specific component on target location withreplace
/append
/prepend
/after
/before
support.CC: @ansarizafar
renderComponent
Reference
renderComponent({ element, target, mode, withTransition }: RenderComponentProps): Never
The
renderComponent
method is used to rerender the component or render some component in an specific target location inside a server action. Outside of an action, it throws an error.renderComponent
needs to be called outside of thetry/catch
block:Note
See the differences between "Action Signals" and
renderComponent
in this documentation.Types:
Parameters:
element
(optional): The component to render. By default, it will rerender the target component that triggered the action.target
(optional): The target location to render the component. It can be a CSS selector.placement
(optional): The placement to render the component. It can bereplace
,before
,after
,append
orprepend
. Default isreplace
.withTransition
(optional): Iftrue
, it will render the component with start view transition API. Default isfalse
.Returns:
Never
does not require you to usereturn renderComponent()
due to using the TypeScriptnever
type.Caution
Avoid using the
renderComponent
inside atry/catch
block. Thenavigate
is a throwable function and will break the execution of the current function.Tip
Updating
Action Signals
by default is going to use arenderComponent
without you having to specify it. If you specify it, it will fulfill only therenderComponent
you specify.Support
renderPage
Reference
renderPage(): Never
The
renderPage
method is used to rerender the page inside a server action. Outside of an action, it throws an error.renderPage
needs to be called outside of thetry/catch
block:Note
See the differences between "Action Signals" and
renderPage
in this documentation.Parameters
withTransition
(optional): A boolean value that indicates whether the rerender should be done with start view transition. Default isfalse
.Types:
Returns:
Never
does not require you to usereturn rerenderInPage()
due to using the TypeScriptnever
type.Caution
Avoid using the
renderPage
inside atry/catch
block. Thenavigate
is a throwable function and will break the execution of the current function.Support