1
2
submitted 4 days ago by ihze@lemmy.org to c/react@programming.dev

I'm learning React and working on my first course project, a CV generator app. I created an initial state - snippet below - which I normalized to an extent. The professional experience field has an Employer + the employer related data (employment dates, position etc.).

I'm encountering two problems with the current structure:

  • the Achievements section of each employer, which has a few subpoints, is in the same place as the company data. I can programatically select only the needed fields to display, but I was wandering if there is a better structure that I'm missing
  • when I add a second, third... employer, all their company data goes in the same place. Again, I can retrieve only what I need based on id, but I was wondering if there is a semantically better choice
const initialPerson = {
  employers: {
    byIds: {
      "employer-1": {
        id: "employer-1",
        name: "Company",
        value: "Test Org 1",
        cdataIds: ["cdata-1", "cdata-2", "cdata-3", "cdata-4", "cdata-5", "cdata-6"],
      },
      // other employers follow 
    },
    allIds: ["employer-1"],
  },
  companyData: {
    byIds: {
      "cdata-1": {
        id: "experience-1",
        name: "Position",
        value: "Test Engineer 1",
      },
      "cdata-2": {
        id: "exp-2",
        name: "Duration",
        value: "Jan. 2025 - Present",
      },
      "cdata-3": {
        id: "exp-3",
        name: "Location",
        value: "Brussels, Belgium",
      },
      "cdata-4": {
        id: "exp-4",
        name: "Achievement",
        value: "STAR: Situation Task Action Result"
      },
      "cdata-5": {
        id: "exp-5",
        name: "Achievement",
        value: "XYZ: Accomplished X as measured by Y by doing Z",
      },
      "cdata-6": {
        id: "exp-6",
        name: "Achievement",
        value: "CAR: Challenge Action Result",
      },
    },
    // data from all employers goes here
    allIds: ["cdata-1", "cdata-2", "cdata-3", "cdata-4", "excdatap-5", "cdata-6"],
  },
}
2
7
3
3
4
5
5
2
6
0
7
11
8
3
9
1

Our @nickschot shares how to integrate @react and @emberjs on our blog, based on learnings from a number of multi-framework projects our team did recently. If you’re looking to mix frameworks and face challenges, reach out.

➡️ https://mainmatter.com/blog/2025/12/12/react-ember/

#react #emberjs

10
2
submitted 1 month ago by nemeski@mander.xyz to c/react@programming.dev
11
4
12
3
submitted 2 months ago by nemeski@mander.xyz to c/react@programming.dev
13
1
14
6
Why use React? (adactio.com)
15
4
16
3
17
5
18
2
19
6
20
7
React vs Backbone in 2025 (backbonenotbad.hyperclay.com)
21
13
22
6
23
3
24
6
25
6
view more: next ›

React

1283 readers
1 users here now

A community for discussing anything related to the React UI framework and it's ecosystem.

https://react.dev/

Wormhole

!pico8@programming.dev

Icon base by Skoll under CC BY 3.0 with modifications to add a gradient

founded 2 years ago
MODERATORS