This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use client' | |
| const UpdateProfileForm = () => { | |
| const changeDisplayName = () => { | |
| updateProfile({ displayName: 'My New Name'}) | |
| } | |
| return (<button onClick={changeDisplayName}/>) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use server' | |
| const ExamplePage = async () => { | |
| const initialData = await fetchData() | |
| ... | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const UpdateProfileForm = () => { | |
| const changeDisplayName = () => { | |
| axios.post('/profile', { | |
| displayName: 'My New Name', | |
| }) | |
| } | |
| return (<button onClick={changeDisplayName}/>) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export const ExamplePage = ({initialData}) => { | |
| ... | |
| } | |
| ExamplePage.getInitialProps = async () => { | |
| return { | |
| initialData: await fetchData() | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export const ExampleComponent = () => { | |
| const [isLoadinging, setIsLoading] = useState(true) | |
| const [data, setData] = useState() | |
| useEffect(() => { | |
| fetchData().then((response) => { | |
| setData(response) | |
| setIsLoading(false) | |
| }) | |
| }, []) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const ComponentC = () => { | |
| return <ComponentA data-test-id="component-a" someProp="Goodbye?" />; | |
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const ComponentA = ({ someProp }) => { | |
| return <div>{someProp}</div>; | |
| }; | |
| export const ComponentB = () => { | |
| return <ComponentA someProp="Hello!" />; | |
| }; |