question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Render (sub)component's variant with handler defined in config

See original GitHub issue

What is a proper way to {{render ...}} sub-component with handler defined in parent-component’s config?

Currently in our team we successfully solved this in a wierd way: {{render '@handler' subComponentContext merge=true}} where subComponentContext property is defined in a YAML config as a string "@handler--variant". Note that @handler and @handler--variant should match the component e.g. name handler.

In other case we tried in eq. {{render subComponentContext}} which generates an error.

I’m not sure if our “wierd way solution” is a bug or a feature… 🤔

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dkhuntrodscommented, Jul 21, 2017
2reactions
dkhuntrodscommented, Jul 21, 2017

@tlenex What’s happening there is that you’re telling Fractal to render@another-partial with @another-partial--my-variant’s context data. By default, any defined views (in this case, the *.hbs file) are included with a variant’s context data, which is why this works. There’s no plan to change this behaviour in v1, but things will work quite differently in v2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Variants - Fractal
Variants are useful when you have one component that has a multiple different possible ... Defining variants in the component's config file.
Read more >
Events Fired During the Rendering Lifecycle | Lightning Aura ...
The component lifecycle starts when the client sends an HTTP request to the server and the component configuration data is returned to the...
Read more >
Render Props - React
A component with a render prop takes a function that returns a React element and calls it instead of implementing its own render...
Read more >
ASP.NET Core Razor component rendering | Microsoft Learn
To render component outside the subtree that is rerendered by a particular event. An asynchronous handler involves multiple asynchronous phases.
Read more >
Rendering Plasmic components
When you render a component using <PlasmicComponent /> , you can use the componentProps prop to control which variants to activate, which slots...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found