HN user

jameskerr

231 karma

Working on UI at Brim Data.

On Twitter @specialcasedev

React, Electron, JavaScript, Ruby

Posts28
Comments29
View on HN
www.jameskerr.blog 7mo ago

It's hard to deny the simple beauty of a function

jameskerr
3pts0
www.jameskerr.blog 2y ago

Three Types of CSS Utility Classes: Composing Good Primitives

jameskerr
2pts0
rollen.io 2y ago

Rendering Markdown Views in Rails

jameskerr
6pts0
www.jameskerr.blog 2y ago

Against Single Element React Components

jameskerr
1pts0
ilo.so 2y ago

Does the Twitter algorithm penalise tweets with links?

jameskerr
2pts0
uxdesign.cc 2y ago

Micro tips for remarkably better typography

jameskerr
2pts0
www.brimdata.io 2y ago

Joining CSV Data Without SQL: An IP Geolocation Use Case

jameskerr
91pts39
uxdesign.cc 2y ago

Transition animations: Principles that can be used by anyone in their UI

jameskerr
2pts0
news.ycombinator.com 2y ago

Ask HN: Data people, what things do you always look for in a new dataset?

jameskerr
4pts2
www.edgedb.com 2y ago

Documentation isn’t the best place to be DRY

jameskerr
5pts2
deno.com 2y ago

Dnt – the easiest way to publish a hybrid NPM module for ESM and CommonJS

jameskerr
2pts0
textual.textualize.io 2y ago

Pull Request Type: Cake or Puppy

jameskerr
1pts0
austinkleon.com 3y ago

McCartney on not-knowing and doing it now

jameskerr
3pts0
www.jameskerr.blog 3y ago

React Hook for Avoiding Flash of Empty UI While Data Transitions

jameskerr
1pts2
github.com 3y ago

Who are your most followed GitHub stargazers?

jameskerr
1pts0
www.data-to-viz.com 3y ago

From Data to Viz: Library of Data Viz Terms, Definitions, and Examples

jameskerr
1pts0
2019.wattenberger.com 3y ago

How to Learn D3.js

jameskerr
2pts0
github.com 3y ago

JSON datasets that don't require authentication.

jameskerr
1pts0
www.brimdata.io 3y ago

Easier data debugging with Zed’s first-class errors

jameskerr
33pts17
www.brimdata.io 3y ago

Wrangling JSON Arrays: Zed vs. SQL

jameskerr
4pts0
www.specialcase.dev 3y ago

TypeScript Classes Are Giving Me Carpal Tunnel

jameskerr
2pts1
react-arborist.netlify.app 3y ago

30k Nodes in a React Tree View

jameskerr
2pts0
github.com 3y ago

React Arborist v2.0 – The Complete Tree View Component (Keyboard Nav and More)

jameskerr
4pts1
www.specialcase.dev 4y ago

Sharing Steps in GitHub Action Workflows

jameskerr
1pts0
twitter.com 4y ago

I Just Learned JavaScript, wait...

jameskerr
3pts1
github.com 4y ago

React Arborist – A full-featured tree component for React

jameskerr
210pts53
hn-alerts.com 5y ago

Daily email of HN stories with more than “x” points

jameskerr
1pts0
news.ycombinator.com 6y ago

Ask HN: Do you use inheritance when programming?

jameskerr
19pts27

I have a Hugo blog and I wish the experience for writing on my phone was better. I need a git client and a markdown editor to publish. Not streamlined, but it’s free.

I agree that it would make sense for substack to provide a good way to write from your phone.

[dead] 3 years ago

To simply share some JavaScript you've got to consider JS runtimes, module formats, and package.json interpretations. Was it easier when cross-browser compatibility was the big headache?

This is a controlled component, so all mutation of the tree data structure will need to happen in the tree's parent component. Add a function in your node renderer (maybe after clicking a trash icon), that deletes the node from the tree state. The component will re-renderer and your node will be gone.

I was thinking of making a generic tree manager class to provide basic functions (move, rename, add, delete) for managing the tree data structure in the parent component. Maybe I'll call it "Arborist"!

Ant tree looks like a great tree library and is certainly more mature than react-arborist. However, react-arborist supports renaming a node, has a slightly different drag and drop feel, and leaves all styling up to the user. Not just the title, icon, and expand buttons.

I agree that the hard-coded DefaultCursor styles need to be configurable. I'll soon update. You'll be able to pass in your own component to render the DropCursor (blue line indicating the new position of the node you're dragging).

Dang it, I can see how the title was deceptive. This is headless component, leaving the markup and styling completely up to the user. Many of the tree components I looked at before building this didn't let me do exactly what I wanted with the style like this one does. However, I was thinking of shipping a default "<Item>" component that comes with some default styling to get people up and running quickly. I've just made an issue for this.

This has been great feedback. To summarize, I heard people use inheritance because its the API of a chosen framework and in rare cases when it proves convenient like UI Elements.

I also remembered that unit test suites are an instance when I've enjoyed inheritance.

But it sounds like most people here do not use inheritance in the business logic of their apps/systems. Composition and dependency injection do the job of sharing code without sacrificing comprehensibility.

Thanks everyone! This all matches my experience as well. I just wanted to make sure I wasn't missing something life-changing!