Next.js Discord

Discord Forum

Simple React Snippets

Answered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
Simple React Snippets isnt working for me please help 🙁
Answered by B33fb0n3
SRS are pretty bugggy. Create one snippes that suits you via VS Code (see attached) and you are good to go.

If you want mine (rfce):
{
"Functional Component": {
    "prefix": [
        "rfce",
    ],
    "body": [
        "type ${1:${TM_FILENAME_BASE:page}}Props = {",
        "",
        "}",
        "",
        "export default function ${1:${TM_FILENAME_BASE:page}}(props: ${1:${TM_FILENAME_BASE:page}}Props) {",
            "return (",
                "<>",
                    "<h1>${1:${TM_FILENAME_BASE:page}}</h1>",
                "</>",
            ")",
        "}",
    ],
    "description": "Create a functional Component"
}
}
View full answer

6 Replies

Asian black bearOP
when i type a snippet i get no sugestions
@Asian black bear when i type a snippet i get no sugestions
SRS are pretty bugggy. Create one snippes that suits you via VS Code (see attached) and you are good to go.

If you want mine (rfce):
{
"Functional Component": {
    "prefix": [
        "rfce",
    ],
    "body": [
        "type ${1:${TM_FILENAME_BASE:page}}Props = {",
        "",
        "}",
        "",
        "export default function ${1:${TM_FILENAME_BASE:page}}(props: ${1:${TM_FILENAME_BASE:page}}Props) {",
            "return (",
                "<>",
                    "<h1>${1:${TM_FILENAME_BASE:page}}</h1>",
                "</>",
            ")",
        "}",
    ],
    "description": "Create a functional Component"
}
}
Answer
@Asian black bear would you recomend another extention
nah, I would recommend you using your own snippets (see mine shared one)
happy to help