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
- Host: GitHub
- URL: https://github.com/suhdev/mobx-react-slot
- Owner: suhdev
- Created: 2019-08-31T11:57:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T08:36:25.000Z (over 3 years ago)
- Last Synced: 2025-02-08T20:14:07.250Z (over 1 year ago)
- Language: JavaScript
- Size: 1.44 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
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'));
```