29.
What is the correct syntax to import only the Component from the React library?
import [ Component ] from 'react';
import { Component } from 'react';
import * as React from 'react';
import React, { Component } from 'react';
Correct: B
To import only the Component from the React library, you can use import { Component } from 'react';. The other options are incorrect. The syntax import [Component] from 'react' is not valid in JavaScript. Using import * as React from 'react'; imports the entire React library, not just the Component. import React, { Component } from 'react'; imports both the entire React library and the Component, not just the Component.