Skip to content
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

Dynamically set the width and height of a component #248

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

michielvandergeest
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@suresh-gangumalla suresh-gangumalla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +256 to +265
$size: (dimensions: {
/**
* Component width
*/
w: number,
/**
* Component height
*/
h: number
}) => void

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @michielvandergeest,

Also If possible I would like to pass props to the element with only one object.

Just for example;

:props: $props, 

Example props objects

 const props1 = {
  fontFamily: 'Arial',
  fontSize: 20,
 }

const props2 = {
   x: 1,
   y: 2,
   w: 100,
   h: 100,
 }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tuncayyildirtanuk, technically this is possible (and we have an experimental branch for this available). But that solution has a performance impact, because changing a single prop value, leads to update attempts of other unchanged props as well.

We're not discarding the idea entirely, because I understand the use case from a developer perspective, but we have to be mindful of the performance impact.

Thanks for the suggestion in any case!

@michielvandergeest michielvandergeest merged commit 356253c into dev Jan 6, 2025
1 check 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.

3 participants