Encountering a SyntaxError when incorporating a Context Provider in my React TypeScript project. The error points to an unexpected token and a missing comma within the JSX.
export const MapProvider: React.FC<React.PropsWithChildren<{}>> = ({ children }) => {
// ...
return (
<MapContext.Provider value={contextValue}>
{children}
</MapContext.Provider>
);
};
I've double-checked my code for syntax errors, confirmed the correct usage of brackets and commas in the JSX return statement, reviewed the context setup, and sought solutions in online discussions.
The Error ` Android Bundling failed 44ms
error: SyntaxError: /home/Workspace/Mobile_App/context/MapContext.ts: Unexpected token, expected "," (96:19)
94 |
95 | return (
> 96 | <MapContext.Provider value={contextValue}>
| ^
97 | {children}
98 | </MapContext.Provider>
99 | )
`