How to fix this ReactLua error?

i have this error with ReactLua in my plugin

Code

An Studio Components Example Code:

local React = require(script.ReactLua.React)
local StudioComponents = require(script.studiocomponents)
local ReactRbx = require(script.ReactLua.ReactRoblox)
local function MyComponent()
	local objs = {
		React.createElement(StudioComponents.Label(), {
			Text = "Hello, from StudioComponents!",
			Size = UDim2.fromScale(1, 1),
		})
	}
	return 
end
local root = ReactRbx.createRoot(game.CoreGui)
root:render(React.createElement(MyComponent, {}, {}))
Output
  15:04:21.653  user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.scheduler.forks.SchedulerHostConfig.default:139: user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.scheduler.forks.SchedulerHostConfig.default:116: 
------ Error caught by React ------
attempt to index nil with 'useContext'
------ Error caught by React ------
user_Folder.rbxmx.Folder.Script.studiocomponents.node_modules.@jsdotlua.react.src.ReactHooks:104 function useContext
user_Folder.rbxmx.Folder.Script.studiocomponents.Hooks.useTheme:30 function useTheme
user_Folder.rbxmx.Folder.Script.studiocomponents.Components.Label:81 function Label
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberHooks.new:3120 function renderWithHooks
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberBeginWork.new:204 function renderWithHooks
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberBeginWork.new:1570 function mountIndeterminateComponent
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberBeginWork.new:3479 function beginWork
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberWorkLoop.new:245
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberWorkLoop.new:1960
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberWorkLoop.new:1845
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberWorkLoop.new:1794
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberWorkLoop.new:930
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.react-reconciler.ReactFiberWorkLoop.new:846
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.scheduler.Scheduler:303
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.scheduler.Scheduler:259
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.scheduler.forks.SchedulerHostConfig.default:80 function doWork
user_Folder.rbxmx.Folder.Script.ReactLua.node_modules.@jsdotlua.scheduler.forks.SchedulerHostConfig.default:103 function performWorkUntilDeadline
  -  Edit - SchedulerHostConfig.default:139

Is it caused by you? Disable all plugins and if it’s still there, might be a Roblox plugin causing it.

yes its my plugin.

dont check this details
       vdsagayvsfguyxdgufgxdjkhdrjehdjhjahxwjdh

Ok bro then how in the world are we as a community supposed to help out on an error that you didn’t even provide the code for. Now this is ragebait

Just don’t use react :moai:
Problem solved frfr

1 Like

this is not solution, StudioComponents is only supporting React

Wdym?
Its just a glorified wrapper that eventually creates roblox instances but in a super bloated way.
You can make regular Luau code look quite nice already:

local Frame = Instance.new("Frame") do
	Frame.Size = UDim2.new(1,0,1,0)
end

1 Like

i do not believe this is actually lua, this is aul (lua backwards)