-
Notifications
You must be signed in to change notification settings - Fork 26
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: use unique identifier for actions #366
Conversation
@@ -67,7 +57,7 @@ export class ReactComponentRenderer<TPropIn> extends ComponentRendererBase< | |||
buildOpeningElementProperties(value, key), | |||
); | |||
const eventAttributes = Object.entries(this.component.events || {}).map(([key, value]) => | |||
buildOpeningElementEvents(value, mapGenericEventToReact(key as StudioGenericEvent)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed mapGenericEventToReact
further down so that we would get the same result form getActionIdentifier
.
I think to reduce the wordiness of this, we may be able to just generate the action name from the component name and action, since that combination should be unique. The action type probably doesn't need be put in the variable, since it's referenced immediately after in the declaration. That's also easy enough to change later, so this overall LGTM. |
Good idea, I will update to this approach. |
c67c534
to
4461037
Compare
If you have any suggestions on how the unique identifier should be constructed please leave a comment. I just went with one structure I though was sensible.
I needed to move some functions to a new file to avoid a cyclical dependency between
action.ts
andreact-component-render-helper.ts
.