Skip to content

Fix Kit rendering context error when render? is false#980

Merged
joeldrapper merged 1 commit into
yippee-fun:mainfrom
stephannv:fix/rendering_context
May 12, 2026
Merged

Fix Kit rendering context error when render? is false#980
joeldrapper merged 1 commit into
yippee-fun:mainfrom
stephannv:fix/rendering_context

Conversation

@stephannv

@stephannv stephannv commented May 9, 2026

Copy link
Copy Markdown
Contributor

Fix #979

I've just moved the ensure to wrap the code where Thread.current is modified.
eg.

# BEFORE
def internal_call(...)
  ...
  code
ensure
  ...
end

# AFTER
def internal_call(...)
  ...
  begin
    code
  ensure
    ...
  end
end

I could just move the previous_phlex_component = Thread.current[:__phlex_component__] to before the return "" unless render? too, but I think this code is clearer.

@joeldrapper
joeldrapper merged commit 8664bae into yippee-fun:main May 12, 2026
0 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error "You can't call ComponentName outside of a Phlex rendering context"

2 participants