Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Deprecates inferno state hook #1098

Merged
merged 1 commit into from
Dec 13, 2023
Merged

Conversation

Steals-The-PRs
Copy link
Collaborator

Mirrored on Skyrat: Skyrat-SS13/Skyrat-tg#25587
Original PR: tgstation/tgstation#80195

About The Pull Request

Marks useLocalState as deprecated. Removes a lot of its usages. I even wrote some documentation to boot!

This is no longer necessary, as it was Inferno specific. Now that we have real hooks, use them!

// Old
const [someState, setSomeState] = useLocalState(context, 'some_state_identifier', false);

// Now
const [someState, setSomeState] = useState(false);

Read more! Or the rest of the React documentation, it's great: React State

Why It's Good For The Game

We don't need uselocalstate anymore. Easier to read and probably faster this way

Changelog

N/A nothing player facing

* Deprecates inferno state hook

* Modular

---------

Co-authored-by: Jeremiah <[email protected]>
Co-authored-by: Giz <[email protected]>
@Iajret Iajret merged commit 92c6a28 into master Dec 13, 2023
23 checks passed
@Iajret Iajret deleted the upstream-mirror-25587 branch December 13, 2023 10:42
Iajret pushed a commit that referenced this pull request Feb 22, 2024
* Fixes CI runtime/race condition with forensics (#81610)

## About The Pull Request

Just a quick fix for the following CI runtime, and additionally passes
through the rest of this file's weakref instances for any other
potential bugs.


![image](https://github.com/tgstation/tgstation/assets/13398309/a58be18a-21e4-40b2-92e0-1a961108c939)

## Why It's Good For The Game

Bugfix

## Changelog

Nothing player facing

---------

Co-authored-by: san7890 <[email protected]>

* Fixes CI runtime/race condition with forensics

---------

Co-authored-by: Bloop <[email protected]>
Co-authored-by: san7890 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants