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

Inline experiment #602

Open
wants to merge 2 commits into
base: v1
Choose a base branch
from
Open

Inline experiment #602

wants to merge 2 commits into from

Conversation

jquense
Copy link
Contributor

@jquense jquense commented May 12, 2020

Throwing this up for thoughts. by itself it's not really a win, but maybe it's worth adding some additional options that only enable it in the simple cases, e.g. no spreads to deal with?

I mostly wrote it so that when ppl say "MEH THERE IS ACTUALLY A RUNTIME" i can point them to this :P

@jquense jquense requested a review from taion May 12, 2020 14:30
@taion
Copy link
Contributor

taion commented May 13, 2020

i mean, it's definitely neat.

if you wanted to do something more robust, you could possibly use something like the existing JSX transform to convert all the props into a single props object, then look at the resulting props.className and props.style.

like, IIFE style?

<Component {...(() => {
const __props = { ...spread, other, foo };
return { __props, style: { __props.style, ... } };
})()}```

@jquense
Copy link
Contributor Author

jquense commented May 13, 2020

ooo that's a cool idea.

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.

None yet

2 participants