
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-shorthand
Advanced tools
React Component library that have some conditional operations and array method as components
React Component library that have some conditional operations and array method as components
Note
We really appreciate your use of our module but please put in considerations that it is still in developpement phase
Note
If there are 2 components grouped togther it means the two can be wroten in all the demoed methods (ex: Every/Some)
If/IfElse take same Props (key prop is for the Map method handler)
import { IfElse } from "react-shorthand";
const variable = "Hello";
function App() {
return (
<IfElse condition={variable === "Hello"}>
<IfElse.If>
<p>How Are You???</p>
</IfElse.If>
<IfElse.Else>
<p>I am Fine</p>
</IfElse.Else>
</IfElse>
);
}
- At(*array, *index, Wrapper)
- Map(*array, *Wrapper) / PS: No need to specify a key \
- Find/Filter/Every/Some(*array, *handler)
import { array } from "react-shorthand";
function Wrapper({ item, index }) {
return (
<p>
{index}.{item.item}
</p>
);
}
function App() {
return (
<array.Map
array={[
{ _id: 1, item: "1" },
{ id: 2, item: "2" },
{ key: 3, item: "3" },
{ item: "4" },
]}
Wrapper={Wrapper}
/>
);
}
import { array } from "react-shorthand";
function App() {
return (
<array.Every array={["1", "2"]} handler={(item) => item === "2"}>
<array.Every.True>
<p>Hello</p>
</array.Every.True>
<array.Every.False>
<p>Good Bay</p>
</array.Every.False>
</array.Every>
);
}
import { array } from "react-shorthand";
function App() {
return (
<array.Some array={["1", "1"]} handler={(item) => item === "1"}>
<p>Hello</p>
</array.Some>
);
}
import { Switch } from "react-shorthand";
function App() {
return (
<Switch expression={"expression"}>
<Switch.Case match="boo" children={<p>boo</p>} />
<Switch.Case match="foo">
<p>foo</p>
</Switch.Case>
<Switch.Default>
<p>bar</p>
</Switch.Default>
</Switch>
);
}
And/Or take same Props
import { Or } from "react-shorthand";
function App() {
return <Or array={[null, "foo"]} />;
}
import { And } from "react-shorthand";
function App() {
return (
<And array={["foo", "bar"]}>
<p>Hello</p>
</And>
);
}
FAQs
React Component library that have some conditional operations and array method as components
We found that react-shorthand demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.