Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@rbxts/react-reflex
Advanced tools
An all-in-one state container.
npm package →
Reflex is a simple state container inspired by Rodux and Silo, designed to be an all-in-one solution for managing and reacting to state in Roblox games.
React Reflex provides React hooks and components for Reflex using either @rbxts/react
or jsdotlua/react
.
See the React Reflex documentation for more information.
Install the @rbxts/react-reflex
package using your package manager of choice.
npm install @rbxts/react-reflex
yarn add @rbxts/react-reflex
pnpm add @rbxts/react-reflex
Add littensy/react-reflex
to your wally.toml
file.
[dependencies]
ReactReflex = "littensy/react-reflex@VERSION"
Use <ReflexProvider>
to enable Reflex hooks and components:
import React, { StrictMode } from "@rbxts/react";
import { createPortal, createRoot } from "@rbxts/react-roblox";
import { ReflexProvider } from "@rbxts/react-reflex";
const root = createRoot(new Instance("Folder"));
root.render(
<StrictMode>
<ReflexProvider producer={producer}>
{/* Your app */}
{createPortal(<App />, playerGui)}
</ReflexProvider>
</StrictMode>,
);
Custom hooks can be created to provide typed hooks for your state:
import { useProducer, useSelector, UseProducerHook, UseSelectorHook } from "@rbxts/react-reflex";
export const useRootProducer: UseProducerHook<RootProducer> = useProducer;
export const useRootSelector: UseSelectorHook<RootProducer> = useSelector;
import React from "@rbxts/react";
import { useRootProducer, useRootSelector } from "./hooks";
export function Counter() {
const producer = useRootProducer();
const count = useRootSelector((state) => state.count);
return (
<textbutton
Text={`Count: ${count}`}
AnchorPoint={new Vector2(0.5, 0.5)}
Size={new UDim2(0, 100, 0, 50)}
Position={new UDim2(0.5, 0, 0.5, 0)}
Event={{
Activated: () => producer.increment(),
MouseButton2Click: () => producer.decrement(),
}}
/>
);
}
This project is licensed under the MIT license.
FAQs
React bindings for Reflex
The npm package @rbxts/react-reflex receives a total of 72 weekly downloads. As such, @rbxts/react-reflex popularity was classified as not popular.
We found that @rbxts/react-reflex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.