What are you trying to accomplish
Pass a prop called “Name” to my component with a default value.
Code stack you are integrating Builder with
NextJs
Reproducible code example
export const Input = ({
name = 'defaultValue',
}: InputProps) => {
console.log('name', name); // Outputs "name undefined" instead of "name defaultValue"
return (
<InputController
name={name}
/>
);
};
Builder.registerComponent(Input, {
name: 'Input',
inputs: [
{
name: 'name',
type: 'string',
required: true,
defaultValue: 'name',
helperText: 'Must be unique',
},
],
});
The output of “name” is expected to be “defaultValue” when the prop is empty/falsy.
but for some unknown reason the output is undefined.
Is the “name” prop taken by BuilderIo?