Skip to content

Commit ea06441

Browse files
chriseppsteinamiller-gh
authored andcommitted
fix: Take inheritance into account during analysis.
1 parent 3656360 commit ea06441

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/css-blocks/src/Block/Inheritable.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export abstract class Inheritable<
112112
* inheritance. Does not include this object or the styles it implies through
113113
* other relationships to this object.
114114
*
115+
* The values are returned in inheritance order, with the first value
116+
* returned (if any) having no base, and the the last value returned (if any)
117+
* being the base of this object.
118+
*
115119
* If nothing is inherited, this returns an empty array.
116120
* @returns The array of nodes this node inherits from.
117121
*/
@@ -127,7 +131,7 @@ export abstract class Inheritable<
127131

128132
/**
129133
* Resolves the child with the given name from this node's inheritance
130-
* chain. Returns undefined if the child is not found.
134+
* chain. Returns null if the child is not found.
131135
* @param name The name of the child to resolve.
132136
* @returns The child node, or `null`
133137
*/

packages/jsx/src/utils/ExpressionReader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export class ExpressionReader {
206206
let dynamicStateExpression: Expression = <Expression>this.callExpression!.arguments[0];
207207
return { block, blockClass, stateGroup, dynamicStateExpression };
208208
} else if (this.stateValue) {
209-
let state = stateGroup.getState(this.stateValue);
209+
let state = stateGroup.resolveState(this.stateValue);
210210
if (!state) {
211211
let message = `No state ${stateGroup.asSource(this.stateValue)} found on block "${this.block}".`;
212212
let valueNames = [...stateGroup.statesMap().values()].map(s => s.asSource());

0 commit comments

Comments
 (0)