MCPcopy Create free account
hub / github.com/nativewind/nativewind / getInvalid

Function getInvalid

packages/nativewind/src/test.tsx:176–209  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174}
175
176function getInvalid() {
177 const style: Record<string, any> = {};
178 const properties: string[] = [];
179
180 let hasStyles = false;
181
182 for (const warnings of getWarnings().values()) {
183 for (const warning of warnings) {
184 switch (warning.type) {
185 case "IncompatibleNativeProperty":
186 properties.push(warning.property);
187 break;
188 case "IncompatibleNativeValue": {
189 hasStyles = true;
190 style[warning.property] = warning.value;
191 break;
192 }
193 case "IncompatibleNativeFunctionValue":
194 // TODO
195 }
196 }
197 }
198
199 if (properties.length && hasStyles) {
200 return {
201 style,
202 properties,
203 };
204 } else if (properties.length) {
205 return { properties };
206 } else if (hasStyles) {
207 return { style };
208 }
209}
210
211export function invalidProperty(...properties: string[]) {
212 return properties.map((property) => ({

Callers 1

renderCurrentTestFunction · 0.85

Calls 1

getWarningsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…