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

https://github.com/suhdev/mobx-react-slot

A mobx-driven React slot implementation
https://github.com/suhdev/mobx-react-slot

Last synced: about 1 year ago
JSON representation

A mobx-driven React slot implementation

Awesome Lists containing this project

README

          

# @stickyants/mobx-react-slot

An implementation of slots using for mobx-driven React apps.

## Usage

```typescript

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { SlotContainer, Slot, SlotContent } from '..';

function App({ children }) {
return (









{children}

);
}

function Counter() {
const [count, setCount] = React.useState(0);

return (


{count}

setCount(count => count + 1)}>Increment

);
}

ReactDOM.render(




Test App

Top Bar 3


Top Bar 4 (overrides 3)




,
document.getElementById('root'));

```