xAI

Grok 4

xAI's flagship has a direct, witty voice and is quick to pull in what is happening right now.

  • Current events
  • Direct answers
  • Brainstorming

Made with Grok 4

Real output from our prompts, unedited.

What changed in solid-state battery production for electric cars in the last twelve months? Give five key developments, each with a source link.

Five Key Developments in Solid-State Battery Production (Last 12 Months)

1. Dongfeng Motor began cold-weather testing of 350 Wh/kg solid-state packs
These deliver over 620 miles (CLTC) and are slated for a production EV by September 2026. 1

2. SAIC Motor completed its all-solid-state pilot line in Shanghai
Mass production with partner Qingtao Power is targeted for 2027. 2

3. QuantumScape opened its Eagle Line pilot facility in California
The line supports scaled manufacturing of its lithium-metal solid-state cells. 4

4. Mercedes-Benz achieved a 745-mile real-world drive with Factorial solid-state cells
The September 2025 test used 106 Ah cells in a modified EQS. 5

5. Karma Automotive launched the first U.S. passenger-vehicle solid-state program
Partnering with Factorial Energy, it targets commercial availability by 2027. 4

  1. [1] Chinese EV Maker Plans 620-Mile Solid-State Battery Cars In 2026
  2. [2] The Solid-State Battery Race Leaves No One on the Sidelines | Gasgoo
  3. [4] Solid-State Battery Milestones Appear Encouraging For Near Future - CleanTechnica
  4. [5] Solid-state EV batteries with 800 miles of range become a reality

Write a React hook `useLocalStorage<T>(key, initial)` that stays in sync across browser tabs.

Overview

useLocalStorage<T> behaves like useState while persisting to localStorage. It syncs across tabs by listening to the native storage event.

Implementation

tsx
import { useState, useEffect } from 'react';

export function useLocalStorage<T>(key: string, initial: T) {
  const [value, setValue] = useState<T>(() => {
    if (typeof window === 'undefined') return initial;
    try {
      const item = localStorage.getItem(key);
      return item ? JSON.parse(item) : initial;
    } catch {
      return initial;
    }
  });

  const setStoredValue = (v: T | ((prev: T) => T)) => {
    const next = v instanceof Function ? v(value) : v;
    setValue(next);
    localStorage.setItem(key, JSON.stringify(next));
  };

  useEffect(() => {
    const onStorage = (e: StorageEvent) => {
      if (e.key === key && e.storageArea === localStorage) {
        setValue(e.newValue ? JSON.parse(e.newValue) : initial);
      }
    };
    window.addEventListener('storage', onStorage);
    return () => window.removeEventListener('storage', onStorage);
  }, [key]);

  return [value, setStoredValue] as const;
}

Usage

tsx
const [theme, setTheme] = useLocalStorage<'light'|'dark'>('theme', 'light');

Changes in one tab instantly appear in others.

Is 1,001 a prime number? Explain how you know in under five lines.

Answer
No, 1001 is not prime.

Reasoning
1001 = 7 × 11 × 13.
Each factor is greater than 1, so it has divisors other than 1 and itself.

Specs

xAI's flagship with a witty, direct personality.

Context window
256K tokens
Longest reply
16K tokens
Thinks before answering
Yes
Understands images
Yes
Reads PDFs
No
Web search and tools
Yes

Compare with