This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
!!! warning | ||
Context is an unstable feature that's being *significantly* revised. See [issue #4](https://github.com/Roblox/roact/issues/4) for current progress. | ||
!!! danger "Unreleased API" | ||
This API is not yet available in a stable Roact release. | ||
|
||
!!! info | ||
This section is incomplete. It's possible that the context API will change before the existing API is ever documented. | ||
It may be available from a recent pre-release or Roact's master branch. | ||
|
||
[TOC] | ||
|
||
Roact supports a feature known as context that helps pass values down the tree without having to pass them through props. | ||
|
||
## Basic Usage | ||
Context is defined by creating a pair of components known as the _Provider_ and the _Consumer_. Roact does this for you with the `Roact.createContext()` API: | ||
|
||
```lua | ||
local MyValueContext = Roact.createContext() | ||
``` | ||
|
||
## Example: Theming | ||
|
||
|
||
## Legacy Context | ||
Roact also has a deprecated version of context that pre-dates the stable context API. It will be removed in a future release, but is currently maintained for backwards-compatibility. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,3 @@ | ||
.api-addition { | ||
display: flex; | ||
align-content: center; | ||
align-items: center; | ||
vertical-align: middle; | ||
|
||
padding: 0.4rem 0.6rem 0.4rem 0.5rem; | ||
background-color: #efffec; | ||
border-left: 0.2rem solid green; | ||
border-radius: 0.1rem; | ||
|
||
line-height: 1; | ||
font-size: 0.64rem; | ||
font-weight: bold; | ||
|
||
box-shadow: | ||
0 2px 2px 0 rgba(0,0,0,.14), | ||
0 1px 5px 0 rgba(0,0,0,.12), | ||
0 3px 1px -2px rgba(0,0,0,.2); | ||
} | ||
|
||
.api-addition::before { | ||
flex: 0 0 1.5rem; | ||
content: "+"; | ||
color: green; | ||
font-size: 1.5em; | ||
text-align: center; | ||
.md-typeset hr { | ||
border-bottom: 2px solid rgba(0, 0, 0, 0.15); | ||
} |