J2Code API for ReactNextJS Document

You can configure the code generation to produce source files that meet your exact requirements.

Configure and Customize

You can configure or customize the code generation process by adding the next two special fields to the JSON business record sample:

  
"j2codeConfig": { ... }

"j2codeConfig_<fieldName>": { ... }

For example:


{
  "FirstName": "Jeremi",
  "MiddleName": "Paxer",
  "LastName": "Harrising",
  "Gender": "Female",
  "j2codeConfig_Gender": {
        "selectorConfig": {
            "selectorViewType": "SelectSingle",
            "selectorOptionSource": "ValueArray",
            "optionValueArrayName": "personGenderNames"
        }
    },

    "j2codeConfig": {
      "multiWordsName": "emergency, contact, person",
      "selectorOptionArraysContainer": {
          "valueArrays": {
              "personGenderNames": [
                  "Male",
                  "Female",
                  "Unknown"
              ]
          }
      }
    }

From the above, the generated root level component will be named as EmergencyContactPerson... defined in a file emergency-contact-person... And on the generated editor form, the field Gender's value will be selected from a predefined array personGenderNames.

How to give different names to the generated ReactNextJS components?

The generated application includes editor forms and grid views for both the root-level object and its nested child objects. By default: Components for the root-level object are named SampleBusinessRecord...Components and saved in files like sample-business-record...ts. Components for child objects are named after their corresponding field names in the parent object. You can customize these names by adding a j2codeConfig block with a multiWordsName field to either the root or any child object. For example:

"j2codeConfig": {
  "multiWordsName": "temporary, employee, record"
}

In this example, the root-level object will generate components named TemporaryEmployeeRecord... and files like temporary-employee-record.... Similarly, if you add the j2codeConfig block to a child object, This will result in ReactNextJS components named using the concatenated form TemporaryEmployeeRecord... and file names like temporary-employee-record....

Generate text files only and generated code follows MIT licenses

© 2025 j2code.app - All Rights Reserved - version 2.0.1