Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scommons/scommons-react
Scala.js facades for core React.js APIs, components and hooks
https://github.com/scommons/scommons-react
facades front-end frontend react react-hooks react-js react-test-renderer reactjs redux scala scala-facade scala-js scalajs scalajs-reactjs
Last synced: 3 months ago
JSON representation
Scala.js facades for core React.js APIs, components and hooks
- Host: GitHub
- URL: https://github.com/scommons/scommons-react
- Owner: scommons
- License: apache-2.0
- Created: 2019-01-12T11:09:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-09T14:25:37.000Z (12 months ago)
- Last Synced: 2024-10-29T23:07:43.148Z (4 months ago)
- Topics: facades, front-end, frontend, react, react-hooks, react-js, react-test-renderer, reactjs, redux, scala, scala-facade, scala-js, scalajs, scalajs-reactjs
- Language: Scala
- Homepage: https://scommons.github.io/scommons-react/
- Size: 669 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/scommons/scommons-react/actions/workflows/ci.yml?query=workflow%3Aci+branch%3Amaster)
[](https://coveralls.io/github/scommons/scommons-react?branch=master)
[](https://index.scala-lang.org/scommons/scommons-react/scommons-react-core)
[](https://www.scala-js.org)## Scala Commons React
[Scala.js](https://www.scala-js.org) facades for common [React.js](https://reactjs.org) utilities and components.It uses excellent [scalajs-reactjs](https://github.com/shogowada/scalajs-reactjs) binding/facade library.
### How to add it to your project
```scala
val scommonsReactVer = "1.0.0-SNAPSHOT"libraryDependencies ++= Seq(
"org.scommons.react" %%% "scommons-react-core" % scommonsReactVer,
"org.scommons.react" %%% "scommons-react-dom" % scommonsReactVer,
"org.scommons.react" %%% "scommons-react-redux" % scommonsReactVer,
"org.scommons.react" %%% "scommons-react-test" % scommonsReactVer % "test",
"org.scommons.react" %%% "scommons-react-test-dom" % scommonsReactVer % "test"
)
```Latest `SNAPSHOT` version is published to [Sonatype Repo](https://oss.sonatype.org/content/repositories/snapshots/org/scommons/), just make sure you added
the proper dependency resolver to your `build.sbt` settings:
```scala
resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
```### How to use it
* Demo Application
* [live demo](https://scommons.github.io/scommons-react/showcase/) => [How to Build and Run](showcase/README.md)
* [AppMain](showcase/src/main/scala/scommons/react/showcase/app/ShowcaseReactApp.scala)
* [AppState](showcase/src/main/scala/scommons/react/showcase/app/ShowcaseState.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/app/ShowcaseStateReducerSpec.scala)
* [CounterActions](showcase/src/main/scala/scommons/react/showcase/app/counter/CounterActions.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/app/counter/CounterActionsSpec.scala)
* [CounterController](showcase/src/main/scala/scommons/react/showcase/app/counter/CounterController.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/app/counter/CounterControllerSpec.scala)
* [CounterPanel](showcase/src/main/scala/scommons/react/showcase/app/counter/CounterPanel.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/app/counter/CounterPanelSpec.scala)
* [CounterState](showcase/src/main/scala/scommons/react/showcase/app/counter/CounterState.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/app/counter/CounterStateReducerSpec.scala)* Components:
* [ClassComponent](showcase/src/main/scala/scommons/react/showcase/ClassComponentDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/ClassComponentDemoSpec.scala)
* [ErrorBoundary](showcase/src/main/scala/scommons/react/showcase/ErrorBoundaryDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/ErrorBoundaryDemoSpec.scala)
* [FunctionComponent](showcase/src/main/scala/scommons/react/showcase/FunctionComponentDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/FunctionComponentDemoSpec.scala)
* [React.memo](showcase/src/main/scala/scommons/react/showcase/ReactMemoDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/ReactMemoDemoSpec.scala)
* [React.Fragment](showcase/src/main/scala/scommons/react/showcase/ReactFragmentDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/ReactFragmentDemoSpec.scala)* React API
* [React.createRef()](showcase/src/main/scala/scommons/react/showcase/ReactRefDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/ReactRefDemoSpec.scala)
* [ReactDOM.createPortal()](showcase/src/main/scala/scommons/react/showcase/dom/ReactPortalDemo.scala)* React Hooks:
* [useState](showcase/src/main/scala/scommons/react/showcase/hooks/UseStateDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/hooks/UseStateDemoSpec.scala)
* [useReducer](showcase/src/main/scala/scommons/react/showcase/hooks/UseReducerDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/hooks/UseReducerDemoSpec.scala)
* [useMemo/useCallback](showcase/src/main/scala/scommons/react/showcase/hooks/UseMemoDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/hooks/UseMemoDemoSpec.scala)
* [useContext](showcase/src/main/scala/scommons/react/showcase/hooks/UseContextDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/hooks/UseContextDemoSpec.scala)
* [useRef](showcase/src/main/scala/scommons/react/showcase/hooks/UseRefDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/hooks/UseRefDemoSpec.scala)
* [useEffect](showcase/src/main/scala/scommons/react/showcase/hooks/UseEffectDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/hooks/UseEffectDemoSpec.scala)
* [useLayoutEffect](showcase/src/main/scala/scommons/react/showcase/hooks/UseLayoutEffectDemo.scala) => [tests](showcase/src/test/scala/scommons/react/showcase/hooks/UseLayoutEffectDemoSpec.scala)### How to Build
To build and run all the tests use the following command:
```bash
sbt test
```## Documentation
You can find more documentation [here](https://scommons.github.io/scommons-react)