Highlight any panel in your dashboard

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 34

  • @mryechkin
    @mryechkin Рік тому +2

    Super neat! Love that data attribute pattern. I can see it being very flexible for component libraries.

  • @tek9ine130
    @tek9ine130 Рік тому +1

    I was literally stalking your channel for new videos and you dropped this haha

  • @BritainRitten
    @BritainRitten Рік тому +9

    That's neat, but then there's (apparently?) no intellisense or type safety between the `highlight` in the caller vs the Highlight component. If I change `highlight` to `highlighted` on one side vs the other, nothing will alert me of an issue.
    Btw, I love your videos, they are well explained. I think the extraction of that very general single-focused wrapping component is very clean otherwise.

    • @samselikoff
      @samselikoff  Рік тому +3

      Great point! I like the simplicity of data attributes (flexible in many environments) but if you wanted to lock it down I guess you could expose some props instead:
      - highlightEnterClassName
      - highlightLeaveClassName
      then wire those up inside the component 👍

    • @jordancutler7552
      @jordancutler7552 Рік тому

      I was wondering the same... Thanks for giving some insight into a type safe approach Sam and awesome video!

  • @AliFahim92
    @AliFahim92 11 місяців тому

    your content is always so effective and really useful. thanks

  • @rockNbrain
    @rockNbrain Рік тому

    nice job dude! tks a lot! I will definetly look for use more data atributes!!

  • @DEV_XO
    @DEV_XO 11 місяців тому

    Thanks Sam!

  • @ArtemMavrin
    @ArtemMavrin Рік тому +1

    Great video and design as always, Sam, inspire me with your lessons. Tell me, what app do you use to record video and screen?

  • @rikudevs
    @rikudevs Рік тому

    The goat. Learned a lot of useful stuff

  • @Smartercow
    @Smartercow Рік тому +2

    Why you use let instead of const?

  • @datoubi
    @datoubi Рік тому

    Awesome job. As always

  • @mdrifat6941
    @mdrifat6941 Рік тому

    Loved the video sir. Your videos helped me a lot to learn framer motion. Will you please create a framer-motion video taking Imperative coding approach using useAnimate hook

  • @pheisar
    @pheisar Рік тому +14

    Anyone feels RSCs is kinda leaky abstraction? This isnt any strong opinion or statement, but i have this feeling that with RSCs we spend a lot of time thinking about how to organize code due to the server and client boundaries instead of the domain we are tackling. I cant quite articulate why but it makes me feel uncomfortable. Thanks for video though, appreciate it as usual.

    • @neociber24
      @neociber24 Рік тому

      I feel you get that with practice, or just mark all as server component and forget about it

  • @aymenbachiri-yh2hd
    @aymenbachiri-yh2hd Місяць тому

    Thank you so much

  • @oscarljimenez5717
    @oscarljimenez5717 Рік тому +3

    Nice video, but those 'let' instead of 'const' is killing me!

  • @ThugLifeModafocah
    @ThugLifeModafocah 9 місяців тому

    this is superb

  • @imperatrona
    @imperatrona Рік тому

    great as always 🔥

  • @nihil_um
    @nihil_um Рік тому

    Simply awesome!

  • @gmjitendra
    @gmjitendra Рік тому

    amazing. thanks Sam.

  • @swarajsaxena00
    @swarajsaxena00 Рік тому +2

    loved the video, how does your naming always get converted to camel case automatically??

    • @serveshchaturvedi2034
      @serveshchaturvedi2034 Рік тому

      If I understand the question correctly, if you rename the variable using F2 or right click -> rename, all the instances within the scope automatically get the correctly renamed.

    • @samselikoff
      @samselikoff  Рік тому

      @@serveshchaturvedi2034 Yep F2 to rename, or for useState I use this snippet: gist.github.com/samselikoff/846f48370086fc502a66a7df7dd0a7cb

  • @kevinpruett
    @kevinpruett Рік тому +1

    Masterful video as always. I’m trying to wrap my head around the refactor to being server component-compliant and what benefits that produces. Am I correct in assuming that the refactor will allow it to initially render in the DOM on load versus needing JS to load and hydrate the component if it remained a client component?

    • @samselikoff
      @samselikoff  Рік тому +2

      Nope - Client Components are pre-rendered so you'd still have HTML for the initial response. The benefit is being able to use Highlight within a Server Component. Highlight itself is still client, so still ships React and hydrates. But the page is RSC, so it can do things only RSC can do, like read data from a database.
      Being able to use Highlight as a component rather than a hook means you could highlight parts of an RSC if a prop changed, for example dynamic data from a database, or data from a cookie (as in the Build UI demo). RSC is not about reducing JS or initially rendering HTML. It's about letting you write React components that do things we previously needed framework-specific APIs for, like getServerSideProps from Next.js or loader() from Remix. That's the benefit of RSC, and so the benefit of giving Highlight an interface that's easy to use from either a SC or a CC is that it's the kind of thing you'd likely want to use in both places.

    • @kevinpruett
      @kevinpruett Рік тому

      @@samselikoff Ahh. Really great explanation. Appreciate the great work 👍

    • @samselikoff
      @samselikoff  Рік тому

      @@kevinpruettyou got it!

  • @ComputersAreRealCool
    @ComputersAreRealCool Рік тому

    How did you create multiple cursors in each of the occurances of the word "visitors" (but exclude some of them) at 2:36? Blew my mind! (Looks like youre using vim, i also use vim but didnt know about that!)

  • @SogMosee
    @SogMosee 11 місяців тому

    Object styles with something like chakra is better than tailwind because tailwind feels like a whole new language to learn and looks like a wall of text rather just an extension of js like react is

  • @faruksardar8829
    @faruksardar8829 Рік тому

    Just curious about which extensions you use in your VS Code, Please mention it 🔥

  • @user-ty1do3qi2z
    @user-ty1do3qi2z Рік тому

    why did you set value type to unknown?

  • @RegalWK
    @RegalWK Рік тому

    so basically we could handle dark/light mode with that approach? It would be a lote harderd to maintain tho