You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We used to rename the imported variable in case layout decorator has naming conflict.
There were 2 issues with the previous approach:
All occurrences of the variable need to be renamed in the current file, its hard to determine the local/global scoped var
It was not able to handle the cases where the layout is passed down to the child components. Not sure if this is standard pattern but I've seen few examples of it.
Its better to rename the decorator itself so that we don't have to update the local vars which might introduce unexpected behavior
So instead of transforming to
import { layout } from "@ember-decorators/component";
import templateLayout from "components/templates/foo";
@layout(templateLayout)
class Foo extends EmberObject {}
it should be:
import { layout as templateLayout } from "@ember-decorators/component";
import layout from "components/templates/foo";
@templateLayout(layout)
class Foo extends EmberObject {}
The text was updated successfully, but these errors were encountered:
We used to rename the imported variable in case
layout
decorator has naming conflict.There were 2 issues with the previous approach:
All occurrences of the variable need to be renamed in the current file, its hard to determine the local/global scoped var
It was not able to handle the cases where the
layout
is passed down to the child components. Not sure if this is standard pattern but I've seen few examples of it.Its better to rename the decorator itself so that we don't have to update the local vars which might introduce unexpected behavior
So instead of transforming to
it should be:
The text was updated successfully, but these errors were encountered: