import { withRouter } from 'next/router' import dynamic from 'next/dynamic' import Link from 'next/link' const RustComponent = dynamic({ loader: async () => { // Import the wasm module const rustModule = await import('../add.wasm') // Return a React component that calls the add_one method on the wasm module return props =>
{rustModule.add_one(props.number)}
} }) const Page = ({ router: { query } }) => { const number = parseInt(query.number || 30) return (
+
) } export default withRouter(Page)