Gathering detailed insights and metrics for reason-react-context
Gathering detailed insights and metrics for reason-react-context
Gathering detailed insights and metrics for reason-react-context
Gathering detailed insights and metrics for reason-react-context
@dck/reason-react-navigation
This is project is based on the great old [reroute](https://github.com/callstackincubator/reroute) module. It's just using the latest Reason React API (hooks & context).
@reason-react-native/safe-area-context
ReScript bindings for react-native-safe-area-context.
@ryb73/bs-react-contextmenu
BuckleScript bindings for https://www.npmjs.com/package/react-contextmenu
@dck/rescript-router
This is project is based on the great old [reroute](https://github.com/callstackincubator/reroute) module. It's just using the latest Reason React API (hooks & context).
npm install reason-react-context
Typescript
Module System
OCaml (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
73 Stars
23 Commits
6 Forks
2 Watchers
2 Branches
2 Contributors
Updated on Jun 04, 2024
Latest Version
0.2.0
Package Id
reason-react-context@0.2.0
Unpacked Size
54.37 kB
Size
8.14 kB
File Count
30
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
This a an implementation of the new context react context api in pure ReasonML
It seems to cover the base api. If there is something missing, please file an issue :D
npm install --save reason-react-context
An example of using this is at https://github.com/Hehk/example-reason-react-context
Creating a context:
1type t = 2 | Light 3 | Dark; 4 5module Context = 6 ReasonReactContext.CreateContext( 7 { 8 type state = t; 9 let name = "Theme"; 10 let defaultValue = Light; 11 } 12 );
Using the Provider module:
1type action =
2 | ChangeTheme(Theme.t);
3
4type state = {theme: Theme.t};
5
6let component = ReasonReact.reducerComponent("App");
7
8let make = _children => {
9 ...component,
10 initialState: () => {theme: Light},
11 reducer: (action, _state) =>
12 switch action {
13 | ChangeTheme(newTheme) => ReasonReact.Update({theme: newTheme})
14 },
15 render: ({send, state}) =>
16 <div className="App">
17 <Theme.Context.Provider value=state.theme>
18 <Background>
19 <button onClick=(_e => send(ChangeTheme(state.theme === Dark ? Light : Dark)))>
20 (ReasonReact.stringToElement("Toggle Theme"))
21 </button>
22 <Title message="Reason Context" />
23 </Background>
24 </Theme.Context.Provider>
25 </div>
26};
Using the Consumer module:
1let component = ReasonReact.statelessComponent("background");
2
3let make = children => {
4 ...component,
5 render: _self =>
6 <Theme.Context.Consumer>
7 ...(
8 theme =>
9 ReasonReact.createDomElement(
10 "div",
11 ~props={"className": theme === Light ? "background-light" : "background-dark"},
12 children
13 )
14 )
15 </Theme.Context.Consumer>
16};
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/21 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
102 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More