@php-script/editor-react
v0.1.2
Published
React wrapper for the <php-script-editor> web component.
Readme
@php-script/editor-react
Documentation: https://php-script.github.io/php-script-editor/packages/react.html
React 18 and 19 wrapper for the <php-script-editor> web component. Loads the element on the client only, so it is safe with SSR.
Installation
npm i @php-script/editor-react monaco-editorUsage
import { useState } from 'react';
import { PhpScriptEditor } from '@php-script/editor-react';
export function ScriptEditor() {
const [code, setCode] = useState('echo "Hello";');
return <PhpScriptEditor value={code} onChange={setCode} configUrl="/php-script/config" />;
}See the documentation for all props, events and methods, and Server and language config for the endpoints.
