An open API service indexing awesome lists of open source software.

https://github.com/hodev-dev/react-logic-components

using JSX as Logic
https://github.com/hodev-dev/react-logic-components

component jsx jsx-renderer react react-native reactive reactjs redux

Last synced: 4 days ago
JSON representation

using JSX as Logic

Awesome Lists containing this project

README

          

# React Logic Components

# install
**no need to use npm** just copy `src/Logics` folder drop into react project because it has `Zero` dependecy
## IF Component
render jsx if variable and check return `` base on given logic otherwise return ``
if there is no `` return null
```js
import IF, { THEN, ELSE } from './Logics/IF';
```
```html


do something


do something else

```
# SWITCH Component
render if case equal to variable if didn't find any case it will render default
```js
import SWITCH, { CASE, DEFAULT } from './Logics/Switch';
```
```html

render ali
render reza
render if no casee found

```
# FOREACH Component
map over data and inject each data `as` props with given name into component
```js
import FOREACH from './Logics/ForEach';
```
```html

```

# Performance
there may be some performance overhead but i didn't notice anything noticable because react is slow by default on render more than 100 element at same time and it considered to be bad practice (virtualized list) for less than that it should be fine