Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including thin-react-context with all npm packages installed. Try it out:

thin-react-context lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

require("react/package.json"); // react is a peer dependency. // require("thin-react-context/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

thin-react-context v1.0.0

This code defines a React context for managing user data in a React application. It imports the React library and a User type from 'thin-backend'. Then, it defines a UserContext interface with four properties: user, userId, setUser, and setUserId. The UserContext is created with default values using React.createContext, which initializes a new context with a default state consisting of user and userId as null, and empty setter functions for setUser and setUserId.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free