DEV Community

Shadab Ali
Shadab Ali

Posted on

[HELP]I want to convert my react/next js component file to text.

I want to convert my react/next js component file to text.

let a.jsx

"use client"

import { useState } from "react"

const Test = () => {
const [number, setNumber] = useState(1)
return (


{number}
onClick={() => {
setNumber(number + 1)
}}
>
increment


)
}
export default Test

when the user clicks on show code for some component I want to show the exact file. with all import and hooks and etc

https://stackoverflow.com/questions/77337786/how-to-get-react-next-js-component-file-as-text

Top comments (0)