JSFiddle - React, Tailwind, and code Playground
by Farzad YZ
JavaScript
function matches(parentState) {
const type = typeof parentState;
if (type === "string") {
const hasDot = type.indexOf(".") !== -1;
if (hasDot) {
} else {
}
} else if (type === "object") {
} else {
throw Error("Invalid parentState passed to matches");
}
}