Skip to content

natgeo7com/natgeo7com-npm-react-global-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

"use client"

import { createGlobalState, useGlobalState } from "natgeo7com-npm-react-global-state"

const g = createGlobalState(1)

function A() {
  const [c, setC] = useGlobalState(g)
  function h() { setC(c + 1) }
  return (
    <>
      <div>{c}</div>
      <button onClick={h}>go</button>
    </>
  )
}

function B() {
  const [c, setC] = useGlobalState(g)
  function h() { setC(c + 1) }
  return (
    <>
      <div>{c}</div>
      <button onClick={h}>go</button>
    </>
  )
}

export { A, B }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors