I am a Senior Software Engineer based in Copenhagen with a background in mathematics. I am currently writing blog posts on various interesting topics.
- Also, I am the proud owner of a cool fox terrier. 🦮
I am a Senior Software Engineer based in Copenhagen with a background in mathematics. I am currently writing blog posts on various interesting topics.
Last week I made a ⚡️ talk at Remix Copenhagen meetup. I thought I make a short blog post about the content if I already gather the material for it. There is a mistake in this code. Can you find it? 🔍 import type { Note } from '@prisma/client'; import { useCatch, useLoaderData } from '@remix-run/react'; import type { LoaderFunction } from '@remix-run/server-runtime'; import { json } from '@remix-run/server-runtime'; import { prisma } from '~/db.server'; /* export type Note = { id: string title: string body: string createdAt: Date updatedAt: Date } */ type LoaderData = { notes: Note[]; }; export const loader: LoaderFunction = async () => { const notes = await prisma.note.findMany({}); return json({ notes }); }; export default function Problem() { const { notes } = useLoaderData<LoaderData>(); return ( <> {notes.map((note) => ( <div key={note.id} className="p flex flex-auto flex-col p-4 sm:p-6 lg:p-8" > <h2 className="text-2xl font-bold">{note.title}</h2> <ul className="text-lg"> <li> Created at: {Intl.DateTimeFormat('en-US').format(note.createdAt)} </li> <li> Updated at: {Intl.DateTimeFormat('en-US').format(note.updatedAt)} </li> <li>Body: {note.body}</li> </ul> </div> ))} </> ); } ⚠️ Solution The problem is with the following lines: ...
Finally, I managed to update my dotfiles today and change for chezmoi for managing them properly. It took a bit of time, but I’m pleased with the result now. If you are interested, you can find them here.
I guess my first post should be something funny so here is one pic of my sleeping dogs. I hope my next post will be something more useful though :)