mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
demo: fix React prop spreading warnings in CodeEditor component (#1321)
This commit is contained in:
@@ -32,16 +32,20 @@ export function CodeEditor({ code, language }: CodeEditorProps) {
|
|||||||
className={`${className} text-sm p-4 w-fit overflow-scroll max-h-[400px] rounded-md`}
|
className={`${className} text-sm p-4 w-fit overflow-scroll max-h-[400px] rounded-md`}
|
||||||
style={style}
|
style={style}
|
||||||
>
|
>
|
||||||
{tokens.map((line, i) => (
|
{tokens.map((line, i) => {
|
||||||
<div key={i} {...getLineProps({ line, key: i })}>
|
const lineProps = getLineProps({ line, key: i });
|
||||||
|
return (<div key={i} className={lineProps.className}
|
||||||
|
style={lineProps.style}>
|
||||||
<span className="inline-block w-4 mr-3 text-gray-500 select-none">
|
<span className="inline-block w-4 mr-3 text-gray-500 select-none">
|
||||||
{i + 1}
|
{i + 1}
|
||||||
</span>
|
</span>
|
||||||
{line.map((token, key) => (
|
{line.map((token, key) => {
|
||||||
<span key={key} {...getTokenProps({ token, key })} />
|
const tokenProps = getTokenProps({token, key})
|
||||||
))}
|
return <span key={key} className={tokenProps.className} style={tokenProps.style} >{tokenProps.children}</span>
|
||||||
</div>
|
|
||||||
))}
|
})}
|
||||||
|
</div>)
|
||||||
|
})}
|
||||||
</pre>
|
</pre>
|
||||||
)}
|
)}
|
||||||
</Highlight>
|
</Highlight>
|
||||||
|
|||||||
Reference in New Issue
Block a user