File size: 1,744 Bytes
979db68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
export const messageDatabase = [
  {
    user: "What is React?",
    llm: "React is a JavaScript library for building user interfaces.",
    type: 0
  },
  {
    user: "How do components work?",
    llm: "Components in React are like building blocks. They encapsulate both the UI elements and their behavior.",
    type: 1
  },
  {
    user: "What are hooks?",
    llm: "Hooks are functions that allow you to use state and other React features in functional components.",
    type: 0
  },
  {
    user: "Explain useState hook",
    llm: "useState is a React hook that lets you add state variables to functional components.",
    type: 0
  },
  {
    user: "What is the virtual DOM?",
    llm: "Virtual DOM is a programming concept where an ideal, or 'virtual', representation of a UI is kept in memory and synced with the 'real' DOM by a library such as ReactDOM.",
    type: 1
  },
  {
    user: "What are props in React?",
    llm: "Props are inputs that allow you to pass data from parent to child components.",
    type: 0
  },
  {
    user: "Explain React lifecycle",
    llm: "React components go through mounting, updating, and unmounting phases, with various methods called at each stage.",
    type: 1
  },
  {
    user: "What is JSX?",
    llm: "JSX is a syntax extension for JavaScript that allows you to write HTML-like code within JavaScript.",
    type: 0
  },
  {
    user: "What is state management?",
    llm: "State management refers to the handling and organization of data within an application, often using tools like Redux or Context API.",
    type: 1
  },
  {
    user: "What are controlled components?",
    llm: "Controlled components are form elements whose values are controlled by React state.",
    type: 0
  }
];