fix: correct syntax of 'use client' directive #1261
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed? Why?
Corrected the syntax of the 'use client' directive, which was previously written as ('use client'); instead of the correct 'use client';.
The 'use client'; directive in Next.js specifies that a component should render on the client side. Writing it as ('use client');, with parentheses, converts it into an expression, which disrupts the syntax. This can lead to build or runtime errors as Next.js may not recognize the directive correctly.
Notes to reviewers
The directive has been rewritten without parentheses, ensuring proper syntax and correct interpretation by Next.js.
How has it been tested?
The fix was manually verified by ensuring the component with the corrected directive
'use client';
rendered correctly without any build or runtime errors in a Next.js environment. Additionally, the application was started locally, and no issues were encountered during the build process.